From a9bfa21860ad8257e576c41eb7551bb60a8e898b61adb662d78d5d4990deda4e Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 26 Nov 2024 03:01:52 +0000 Subject: [PATCH] - Add patch do-not-add-invalid-ipv6.patch: * Do not check invalid IPv6 addresses. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-w3lib?expand=0&rev=28 --- .gitattributes | 23 ++++ .gitignore | 1 + do-not-add-invalid-ipv6.patch | 16 +++ python-w3lib.changes | 190 ++++++++++++++++++++++++++++++++++ python-w3lib.spec | 80 ++++++++++++++ w3lib-2.2.1.tar.gz | 3 + 6 files changed, 313 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 do-not-add-invalid-ipv6.patch create mode 100644 python-w3lib.changes create mode 100644 python-w3lib.spec create mode 100644 w3lib-2.2.1.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/do-not-add-invalid-ipv6.patch b/do-not-add-invalid-ipv6.patch new file mode 100644 index 0000000..119c0b6 --- /dev/null +++ b/do-not-add-invalid-ipv6.patch @@ -0,0 +1,16 @@ +Index: w3lib-2.2.1/tests/test_url.py +=================================================================== +--- w3lib-2.2.1.orig/tests/test_url.py ++++ w3lib-2.2.1/tests/test_url.py +@@ -420,8 +420,9 @@ KNOWN_SAFE_URL_STRING_URL_ISSUES = { + # (%) are not escaped. + f"a://example.com#{FRAGMENT_TO_ENCODE}", + } +-if sys.version_info < (3, 11, 4): +- KNOWN_SAFE_URL_STRING_URL_ISSUES.add("http://[2a01:5cc0:1:2:3:4]") # Invalid IPv6 ++# openSUSE: All of our Python 3.10+ interpreters will fail this ++#if sys.version_info < (3, 11, 4): ++# KNOWN_SAFE_URL_STRING_URL_ISSUES.add("http://[2a01:5cc0:1:2:3:4]") # Invalid IPv6 + + + @pytest.mark.parametrize( diff --git a/python-w3lib.changes b/python-w3lib.changes new file mode 100644 index 0000000..37fa0cc --- /dev/null +++ b/python-w3lib.changes @@ -0,0 +1,190 @@ +------------------------------------------------------------------- +Tue Nov 26 03:01:17 UTC 2024 - Steve Kowalik + +- Add patch do-not-add-invalid-ipv6.patch: + * Do not check invalid IPv6 addresses. + +------------------------------------------------------------------- +Thu Jun 13 15:36:49 UTC 2024 - Dirk Müller + +- update to 2.2.1: + * :func:`~w3lib.url.canonicalize_url` no longer applies + lowercase to the userinfo URL component. (#229, #230) + +------------------------------------------------------------------- +Mon Jun 10 09:25:26 UTC 2024 - Dirk Müller + +- update to 2.2.0: + * Dropped Python 3.7 support (#214). + * Added Python 3.12 and PyPy 3.10 support (#218). + * Added the description to the package metadata (#227). + * Improved type hints (#226). + * Added the ``pre-commit`` configuration, code reformatted with + ``black`` + * Updated CI configuration (#217, #227). +- use PEP517 build + +------------------------------------------------------------------- +Fri Jan 12 08:28:28 UTC 2024 - Dirk Müller + +- update to 2.1.2: + * Fix test failures on Python 3.11.4+ (#212, #213). + * Fix an incorrect type hint (#211). + * Add project URLs to setup.py (#215). + * Dropped Python 3.6 support, and made Python 3.11 support + official. + * :func:`~w3lib.url.safe_url_string` now generates safer + URLs. + * :func:`~w3lib.url.canonicalize_url` now strips spaces from + the input URL, to be more in line with the `URL living standard`_. + * :func:`~w3lib.html.get_base_url` now ignores HTML comments. + * Fixed :func:`~w3lib.url.safe_url_string` re-encoding + percent signs on the URL username and password even when + they were being used as part of an escape sequence. (#187, #196) + * Fixed :func:`~w3lib.http.basic_auth_header` using the wrong + flavor of base64 encoding, which could prevent authentication + in rare cases. + * Python 2 is no longer supported; + * The ``w3lib.form`` module is removed. + * The ``w3lib.html.remove_entities`` function is removed. + * The ``w3lib.url.urljoin_rfc`` function is removed. + * The following functions are deprecated, and will be removed + in future releases + * Type annotations are added (#172, #184). + * Added support for Python 3.9 and 3.10 (#168, #176). + * Fixed :func:`w3lib.html.get_meta_refresh` for ```` tags + where ``http-equiv`` is written after ``content`` (#179). + * Fixed :func:`w3lib.url.safe_url_string` for IDNA domains with + ports (#174). + * :func:`w3lib.url.url_query_cleaner` no longer adds an + unneeded ``#`` when ``keep_fragments=True`` is passed, and + the URL doesn't have a fragment + * Removed a workaround for an ancient pathname2url bug (#142) + * CI is migrated to GitHub Actions (#166, #177); other CI + improvements + * The code is formatted using black (#173). +- drop 166-add-xfail-test_add_or_replace_parameter_fail.patch, + python-w3lib-no-six.patch: upstream + +------------------------------------------------------------------- +Fri Oct 14 19:10:33 UTC 2022 - pgajdos@suse.com + +- do not require six +- added patches + https://github.com/scrapy/w3lib/commit/c16d7bac3af3148b7018c67ef7922a5da6b3e640 + + python-w3lib-no-six.patch + +------------------------------------------------------------------- +Fri Mar 19 14:28:28 UTC 2021 - Matej Cepl + +- Add 166-add-xfail-test_add_or_replace_parameter_fail.patch, + which makes tests working with CVE-2021-23336 (bsc#1181270). + +------------------------------------------------------------------- +Wed Jul 22 11:05:23 UTC 2020 - Marketa Calabkova + +- update to 1.22.0 + * Python 3.4 is no longer supported (issue #156) + * :func:`w3lib.url.safe_url_string` now supports an optional ``quote_path`` + parameter to disable the percent-encoding of the URL path + * more small fixes and improvements + +------------------------------------------------------------------- +Thu Aug 29 13:15:56 UTC 2019 - Marketa Calabkova + +- update to 1.21.0 + * Add the "encoding" and "path_encoding" parameters to + w3lib.url.safe_download_url (issue #118) + * w3lib.url.safe_url_string now also removes tabs and new lines + (issue #133) + * w3lib.html.remove_comments now also removes truncated comments + (issue #129) + * w3lib.html.remove_tags_with_content no longer removes tags which + start with the same text as one of the specified tags (issue #114) + +------------------------------------------------------------------- +Fri Mar 29 09:53:27 UTC 2019 - pgajdos@suse.com + +- version update to 1.20.0 + * Fix url_query_cleaner to do not append "?" to urls without a + query string (issue #109) + * Add support for Python 3.7 and drop Python 3.3 (issue #113) + * Add `w3lib.url.add_or_replace_parameters` helper (issue #117) + * Documentation fixes (issue #115) + +------------------------------------------------------------------- +Tue Dec 4 12:56:15 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Fri Nov 16 18:49:26 UTC 2018 - Todd R + +- Update to version 1.19.0 + * Add a workaround for CPython segfault (https://bugs.python.org/issue32583) + which affect w3lib.encoding functions. This is technically **backwards + incompatible** because it changes the way non-decodable bytes are replaced + (in some cases instead of two ``\ufffd`` chars you can get one). + As a side effect, the fix speeds up decoding in Python 3.4+. + * Add 'encoding' parameter for w3lib.http.basic_auth_header. + * Fix pypy testing setup, add pypy3 to CI. + +------------------------------------------------------------------- +Thu Dec 21 22:45:16 UTC 2017 - mpluskal@suse.com + +- Update to version 1.18.0: + * No upstream changelog available +- Convert to singlespec + +------------------------------------------------------------------- +Thu Jun 2 16:54:55 UTC 2016 - jacobwinski@gmail.com + +- Update to 1.14.2 (2016-04-11) + * fix function import for (deprecated) ``urljoin_rfc`` (issue #51) + * only expose wanted functions from ``w3lib.url``, via ``__all__`` + (see issue #54, https://github.com/scrapy/scrapy/issues/1917) +- Update to 1.14.1 (2016-04-07) + * For bytes URLs, when supplied encoding (or default UTF8) is wrong, + ``safe_url_string`` falls back to percent-encoding offending bytes. +- Update to 1.14.0 (2016-04-06) + * proper handling of non-ASCII characters in Python2 and Python3 + * support IDNs + * new `path_encoding` to override default UTF-8 when serializing non-ASCII + characters before percent-encoding + * html_body_declared_encoding also detects encoding when not sole attribute + in ````. + * Package is now properly marked as ``zip_safe``. +- Update to 1.13.0 (2015-11-05) + * remove_tags removes uppercase tags as well; + * ignore meta-redirects inside script or noscript tags by default, + but add an option to not ignore them; + * replace_entities now handles entities without trailing semicolon; + * fixed uncaught UnicodeDecodeError when decoding entities. +- Update to 1.12.0 (2015-06-29) + * meta_refresh regex now handles leading newlines and whitespaces in the url; + * include tests folder in source distribution. +- Update to 1.11.0 (2015-01-13) + * url_query_cleaner now supports str or list parameters; + * add support for resolving base URLs in tags with attributes + before href. +- Update spec file to reflect new upstream package requirements. + +------------------------------------------------------------------- +Fri Sep 5 10:08:16 UTC 2014 - toddrme2178@gmail.com + +- Update to version 1.10.0 + + See https://github.com/scrapy/w3lib/commits/v1.10.0 for a list + of changes. + +------------------------------------------------------------------- +Fri Nov 15 20:36:22 UTC 2013 - p.drouand@gmail.com + +- Update to version 1.5 + + No changelog available +- Add python-setuptools BuildRequires; new dependency + +------------------------------------------------------------------- +Wed May 23 21:43:14 UTC 2012 - jfunk@funktronics.ca + +- Initial release + diff --git a/python-w3lib.spec b/python-w3lib.spec new file mode 100644 index 0000000..47f7efa --- /dev/null +++ b/python-w3lib.spec @@ -0,0 +1,80 @@ +# +# spec file for package python-w3lib +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-w3lib +Version: 2.2.1 +Release: 0 +Summary: Library of Web-Related Functions +License: BSD-3-Clause +URL: https://github.com/scrapy/w3lib +Source: https://files.pythonhosted.org/packages/source/w/w3lib/w3lib-%{version}.tar.gz +# PATCH-FIX-OPENSUSE Do not check invalid IPv6 addresses +Patch0: do-not-add-invalid-ipv6.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%python_subpackages + +%description +This is a Python library of web-related functions, such as: + +* remove comments, or tags from HTML snippets + +* extract base url from HTML snippets + +* translate entites on HTML strings + +* encoding mulitpart/form-data + +* convert raw HTTP headers to dicts and vice-versa + +* construct HTTP auth header + +* converting HTML pages to unicode + +* RFC-compliant url joining + +* sanitize urls (like browsers do) + +* extract arguments from urls + +%prep +%autosetup -p1 -n w3lib-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%doc README.rst +%license LICENSE +%{python_sitelib}/w3lib +%{python_sitelib}/w3lib-%{version}.dist-info + +%changelog diff --git a/w3lib-2.2.1.tar.gz b/w3lib-2.2.1.tar.gz new file mode 100644 index 0000000..50576cb --- /dev/null +++ b/w3lib-2.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:756ff2d94c64e41c8d7c0c59fea12a5d0bc55e33a531c7988b4a163deb9b07dd +size 49603