Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-pyquery for openSUSE:Factory checked in at 2022-04-02 18:19:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pyquery (Old) and /work/SRC/openSUSE:Factory/.python-pyquery.new.1900 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyquery" Sat Apr 2 18:19:49 2022 rev:19 rq:965832 version:1.4.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pyquery/python-pyquery.changes 2020-08-25 12:37:17.897392473 +0200 +++ /work/SRC/openSUSE:Factory/.python-pyquery.new.1900/python-pyquery.changes 2022-04-02 18:19:50.262748465 +0200 @@ -1,0 +2,8 @@ +Wed Mar 30 08:07:39 UTC 2022 - Dirk M??ller <dmuel...@suse.com> + +- update to 1.4.3: + * No longer use a universal wheel + * Fix exception raised when calling `PyQuery("<textarea></textarea>").text()` + * python2 is no longer supported + +------------------------------------------------------------------- Old: ---- pyquery-1.4.1.tar.gz New: ---- pyquery-1.4.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyquery.spec ++++++ --- /var/tmp/diff_new_pack.Zk7WxW/_old 2022-04-02 18:19:50.750742987 +0200 +++ /var/tmp/diff_new_pack.Zk7WxW/_new 2022-04-02 18:19:50.754742942 +0200 @@ -1,7 +1,7 @@ # -# spec file for package python-pyquery +# spec file # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,7 +26,7 @@ %bcond_with test %endif Name: python-pyquery%{psuffix} -Version: 1.4.1 +Version: 1.4.3 Release: 0 Summary: A jQuery-like library for python License: BSD-3-Clause ++++++ pyquery-1.4.1.tar.gz -> pyquery-1.4.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/CHANGES.rst new/pyquery-1.4.3/CHANGES.rst --- old/pyquery-1.4.1/CHANGES.rst 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/CHANGES.rst 2020-11-21 10:17:41.000000000 +0100 @@ -1,3 +1,16 @@ +1.4.3 (2020-11-21) +------------------ + +- No longer use a universal wheel + + +1.4.2 (2020-11-21) +------------------ + +- Fix exception raised when calling `PyQuery("<textarea></textarea>").text()` + +- python2 is no longer supported + 1.4.1 (2019-10-26) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/PKG-INFO new/pyquery-1.4.3/PKG-INFO --- old/pyquery-1.4.1/PKG-INFO 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/PKG-INFO 2020-11-21 10:17:41.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pyquery -Version: 1.4.1 +Version: 1.4.3 Summary: A jquery-like library for python Home-page: https://github.com/gawel/pyquery Author: Olivier Lauzanne @@ -89,6 +89,19 @@ News ==== + 1.4.3 (2020-11-21) + ------------------ + + - No longer use a universal wheel + + + 1.4.2 (2020-11-21) + ------------------ + + - Fix exception raised when calling `PyQuery("<textarea></textarea>").text()` + + - python2 is no longer supported + 1.4.1 (2019-10-26) ------------------ @@ -348,7 +361,6 @@ Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Development Status :: 5 - Production/Stable -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/docs/tips.rst new/pyquery-1.4.3/docs/tips.rst --- old/pyquery-1.4.1/docs/tips.rst 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/docs/tips.rst 2020-11-21 10:17:41.000000000 +0100 @@ -7,7 +7,7 @@ Making links absolute --------------------- -You can make links absolute which can be usefull for screen scrapping:: +You can make links absolute which can be useful for screen scrapping:: >>> d = pq(url=your_url, parser='html') >>> d('form').attr('action') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/pyquery/__init__.py new/pyquery-1.4.3/pyquery/__init__.py --- old/pyquery-1.4.1/pyquery/__init__.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/pyquery/__init__.py 2020-11-21 10:17:41.000000000 +0100 @@ -1,5 +1,3 @@ -# -*- coding:utf-8 -*- -# # Copyright (C) 2008 - Olivier Lauzanne <olauza...@gmail.com> # # Distributed under the BSD license, see LICENSE.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/pyquery/cssselectpatch.py new/pyquery-1.4.3/pyquery/cssselectpatch.py --- old/pyquery-1.4.1/pyquery/cssselectpatch.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/pyquery/cssselectpatch.py 2020-11-21 10:17:41.000000000 +0100 @@ -1,5 +1,3 @@ -# -*- coding:utf-8 -*- -# # Copyright (C) 2008 - Olivier Lauzanne <olauza...@gmail.com> # # Distributed under the BSD license, see LICENSE.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/pyquery/openers.py new/pyquery-1.4.3/pyquery/openers.py --- old/pyquery-1.4.1/pyquery/openers.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/pyquery/openers.py 2020-11-21 10:17:41.000000000 +0100 @@ -1,17 +1,7 @@ # -*- coding: utf-8 -*- -import sys - -PY3k = sys.version_info >= (3,) - -if PY3k: - from urllib.request import urlopen - from urllib.parse import urlencode - from urllib.error import HTTPError - basestring = (str, bytes) -else: - from urllib2 import urlopen # NOQA - from urllib import urlencode # NOQA - from urllib2 import HTTPError +from urllib.request import urlopen +from urllib.parse import urlencode +from urllib.error import HTTPError try: import requests @@ -21,6 +11,8 @@ DEFAULT_TIMEOUT = 60 +basestring = (str, bytes) + allowed_args = ( 'auth', 'data', 'headers', 'verify', 'cert', 'config', 'hooks', 'proxies', 'cookies' @@ -43,7 +35,7 @@ url += data data = None - if data and PY3k: + if data: data = data.encode('utf-8') return url, data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/pyquery/pyquery.py new/pyquery-1.4.3/pyquery/pyquery.py --- old/pyquery-1.4.1/pyquery/pyquery.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/pyquery/pyquery.py 2020-11-21 10:17:41.000000000 +0100 @@ -1,10 +1,10 @@ -# -*- coding:utf-8 -*- -# # Copyright (C) 2008 - Olivier Lauzanne <olauza...@gmail.com> # # Distributed under the BSD license, see LICENSE.txt from .cssselectpatch import JQueryTranslator from collections import OrderedDict +from urllib.parse import urlencode +from urllib.parse import urljoin from .openers import url_opener from .text import extract_text from copy import deepcopy @@ -12,53 +12,14 @@ import lxml.html import inspect import types -import sys - - -PY3k = sys.version_info >= (3,) - -try: - unicode -except NameError: - unicode = str - -if PY3k: - from urllib.parse import urlencode - from urllib.parse import urljoin - basestring = (str, bytes) - string_types = (str,) - text_type = str - - def getargspec(func): - args = inspect.signature(func).parameters.values() - return [p.name for p in args - if p.kind == p.POSITIONAL_OR_KEYWORD] - - def getdefaultsspec(func): - return func.__defaults__ - - def func_globals(f): - return f.__globals__ - def func_code(f): - return f.__code__ -else: - from urllib import urlencode # NOQA - from urlparse import urljoin # NOQA - string_types = (unicode, str) - text_type = unicode +basestring = (str, bytes) - def getargspec(func): - return list(inspect.getargspec(func).args) - def getdefaultsspec(func): - return inspect.getargspec(func).defaults - - def func_globals(f): - return f.func_globals - - def func_code(f): - return f.func_code +def getargspec(func): + args = inspect.signature(func).parameters.values() + return [p.name for p in args + if p.kind == p.POSITIONAL_OR_KEYWORD] def with_camel_case_alias(func): @@ -76,8 +37,8 @@ parts = list(alias.split('_')) name = parts[0] + ''.join([p.title() for p in parts[1:]]) func = getattr(PyQuery, alias) - f = types.FunctionType(func_code(func), func_globals(func), - name, getdefaultsspec(func)) + f = types.FunctionType(func.__code__, func.__globals__, + name, func.__defaults__) f.__doc__ = ( 'Alias for :func:`~pyquery.pyquery.PyQuery.%s`') % func.__name__ setattr(PyQuery, name, f.__get__(None, PyQuery)) @@ -129,7 +90,7 @@ def callback(func, *args): - return func(*args[:func_code(func).co_argcount]) + return func(*args[:func.__code__.co_argcount]) class NoDefault(object): @@ -188,7 +149,7 @@ self.parser = kwargs.pop('parser', None) if (len(args) >= 1 and - isinstance(args[0], string_types) and + isinstance(args[0], str) and args[0].split('://', 1)[0] in ('http', 'https')): kwargs['url'] = args[0] if len(args) >= 2: @@ -294,7 +255,7 @@ if args[0] == '': return self._copy([]) if (len(args) == 1 and - isinstance(args[0], string_types) and + isinstance(args[0], str) and not args[0].startswith('<')): args += (self,) result = self._copy(*args, parent=self, **kwargs) @@ -379,12 +340,11 @@ <script><![[CDATA[ ]></script> """ - encoding = str if PY3k else None - return ''.join([etree.tostring(e, encoding=encoding) for e in self]) + return ''.join([etree.tostring(e, encoding=str) for e in self]) def __unicode__(self): """xml representation of current nodes""" - return u''.join([etree.tostring(e, encoding=text_type) + return u''.join([etree.tostring(e, encoding=str) for e in self]) def __html__(self): @@ -396,7 +356,7 @@ <script><![[CDATA[ ]></script> """ - return u''.join([lxml.html.tostring(e, encoding=text_type) + return u''.join([lxml.html.tostring(e, encoding=str) for e in self]) def __repr__(self): @@ -410,15 +370,7 @@ r.append('<%s%s%s>' % (el.tag, id, c)) return '[' + (', '.join(r)) + ']' except AttributeError: - if PY3k: - return list.__repr__(self) - else: - for el in self: - if isinstance(el, text_type): - r.append(el.encode('utf-8')) - else: - r.append(el) - return repr(r) + return list.__repr__(self) @property def root(self): @@ -626,11 +578,11 @@ try: for i, this in enumerate(self): if len(args) == 1: - func_globals(selector)['this'] = this + selector.__globals__['this'] = this if callback(selector, i, this): elements.append(this) finally: - f_globals = func_globals(selector) + f_globals = selector.__globals__ if 'this' in f_globals: del f_globals['this'] return self._copy(elements, parent=self) @@ -710,11 +662,11 @@ """ try: for i, element in enumerate(self): - func_globals(func)['this'] = element + func.__globals__['this'] = element if callback(func, i, element) is False: break finally: - f_globals = func_globals(func) + f_globals = func.__globals__ if 'this' in f_globals: del f_globals['this'] return self @@ -739,7 +691,7 @@ items = [] try: for i, element in enumerate(self): - func_globals(func)['this'] = element + func.__globals__['this'] = element result = callback(func, i, element) if result is not None: if not isinstance(result, list): @@ -747,7 +699,7 @@ else: items.extend(result) finally: - f_globals = func_globals(func) + f_globals = func.__globals__ if 'this' in f_globals: del f_globals['this'] return self._copy(items, parent=self) @@ -1053,6 +1005,7 @@ if tag.tag == 'select': if not isinstance(value, list): value = [value] + def _make_option_selected(_, elem): pq = self._copy(elem) if pq.attr('value') in value: @@ -1061,6 +1014,7 @@ del value[:] # Ensure it toggles first match else: pq.removeAttr('selected') + self._copy(tag)('option').each(_make_option_selected) continue # Stringify array @@ -1110,16 +1064,16 @@ tag = self[0] children = tag.getchildren() if not children: - return tag.text + return tag.text or '' html = tag.text or '' if 'encoding' not in kwargs: - kwargs['encoding'] = text_type + kwargs['encoding'] = str html += u''.join([etree.tostring(e, **kwargs) for e in children]) return html else: if isinstance(value, self.__class__): - new_html = text_type(value) + new_html = str(value) elif isinstance(value, basestring): new_html = value elif not value: @@ -1164,7 +1118,7 @@ if e0.tail: e0 = deepcopy(e0) e0.tail = '' - return etree.tostring(e0, encoding=text_type, method=method) + return etree.tostring(e0, encoding=str, method=method) def text(self, value=no_default, **kwargs): """Get or set the text representation of sub nodes. @@ -1517,13 +1471,12 @@ """ def __setattr__(self, name, func): def fn(self, *args, **kwargs): - func_globals(func)['this'] = self + func.__globals__['this'] = self return func(*args, **kwargs) fn.__name__ = name setattr(PyQuery, name, fn) fn = Fn() - ######## # AJAX # ######## @@ -1531,8 +1484,8 @@ @with_camel_case_alias def serialize_array(self): """Serialize form elements as an array of dictionaries, whose structure - mirrors that produced by the jQuery API. Notably, it does not handle the - deprecated `keygen` form element. + mirrors that produced by the jQuery API. Notably, it does not handle + the deprecated `keygen` form element. >>> d = PyQuery('<form><input name="order" value="spam"></form>') >>> d.serialize_array() == [{'name': 'order', 'value': 'spam'}] @@ -1558,7 +1511,6 @@ """ return urlencode(self.serialize_pairs()).replace('+', '%20') - ##################################################### # Additional methods that are not in the jQuery API # ##################################################### @@ -1604,8 +1556,8 @@ def _filter_out_unchecked(_, el): el = controls._copy(el) - return not el.is_(':checkbox:not(:checked)') \ - and not el.is_(':radio:not(:checked)') + return not el.is_(':checkbox:not(:checked)') and \ + not el.is_(':radio:not(:checked)') controls = controls.filter(_filter_out_unchecked) # jQuery serializes inputs with the datalist element as an ancestor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/pyquery/text.py new/pyquery-1.4.3/pyquery/text.py --- old/pyquery-1.4.1/pyquery/text.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/pyquery/text.py 2020-11-21 10:17:41.000000000 +0100 @@ -1,21 +1,4 @@ import re -import sys - - -PY3k = sys.version_info >= (3,) - -try: - unicode -except NameError: - unicode = str - - -if PY3k: - def is_string(s): - return isinstance(s, str) -else: - def is_string(s): - return isinstance(s, (unicode, str)) # https://developer.mozilla.org/en-US/docs/Web/HTML/Inline_elements#Elements @@ -57,12 +40,12 @@ if not parts: return parts for start_idx, pt in enumerate(parts): - if is_string(pt): + if isinstance(pt, str): # 0, 1, 2, index of first string [start_idx:... break iterator = enumerate(parts[:start_idx - 1 if start_idx > 0 else None:-1]) for end_idx, pt in iterator: - if is_string(pt): # 0=None, 1=-1, 2=-2, index of last string + if isinstance(pt, str): # 0=None, 1=-1, 2=-2, index of last string break return parts[start_idx:-end_idx if end_idx > 0 else None] @@ -78,7 +61,7 @@ orp_buf[:] = [] for x in parts: - if not is_string(x): + if not isinstance(x, str): flush() output.append(x) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/pyquery.egg-info/PKG-INFO new/pyquery-1.4.3/pyquery.egg-info/PKG-INFO --- old/pyquery-1.4.1/pyquery.egg-info/PKG-INFO 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/pyquery.egg-info/PKG-INFO 2020-11-21 10:17:41.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pyquery -Version: 1.4.1 +Version: 1.4.3 Summary: A jquery-like library for python Home-page: https://github.com/gawel/pyquery Author: Olivier Lauzanne @@ -89,6 +89,19 @@ News ==== + 1.4.3 (2020-11-21) + ------------------ + + - No longer use a universal wheel + + + 1.4.2 (2020-11-21) + ------------------ + + - Fix exception raised when calling `PyQuery("<textarea></textarea>").text()` + + - python2 is no longer supported + 1.4.1 (2019-10-26) ------------------ @@ -348,7 +361,6 @@ Platform: UNKNOWN Classifier: Intended Audience :: Developers Classifier: Development Status :: 5 - Production/Stable -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/pyquery.egg-info/SOURCES.txt new/pyquery-1.4.3/pyquery.egg-info/SOURCES.txt --- old/pyquery-1.4.1/pyquery.egg-info/SOURCES.txt 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/pyquery.egg-info/SOURCES.txt 2020-11-21 10:17:41.000000000 +0100 @@ -40,7 +40,6 @@ tests/__init__.py tests/apps.py tests/browser_base.py -tests/compat.py tests/doctests.rst tests/geckodriver.sh tests/invalid.xml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/setup.cfg new/pyquery-1.4.3/setup.cfg --- old/pyquery-1.4.1/setup.cfg 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/setup.cfg 2020-11-21 10:17:41.000000000 +0100 @@ -10,9 +10,6 @@ with-coverage = 1 doctest-options = +ELLIPSIS,+NORMALIZE_WHITESPACE -[bdist_wheel] -universal = 1 - [egg_info] tag_build = tag_date = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/setup.py new/pyquery-1.4.3/setup.py --- old/pyquery-1.4.1/setup.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/setup.py 2020-11-21 10:17:41.000000000 +0100 @@ -40,7 +40,7 @@ """ % read('README', 'CHANGES') -version = '1.4.1' +version = '1.4.3' setup(name='pyquery', version=version, @@ -49,7 +49,6 @@ classifiers=[ "Intended Audience :: Developers", "Development Status :: 5 - Production/Stable", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/tests/apps.py new/pyquery-1.4.3/tests/apps.py --- old/pyquery-1.4.1/tests/apps.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/tests/apps.py 2020-11-21 10:17:41.000000000 +0100 @@ -2,18 +2,17 @@ from webob import Request from webob import Response from webob import exc -from .compat import b def input_app(environ, start_response): resp = Response() req = Request(environ) if req.path_info == '/': - resp.body = b('<input name="youyou" type="text" value="" />') + resp.body = b'<input name="youyou" type="text" value="" />' elif req.path_info == '/submit': - resp.body = b('<input type="submit" value="OK" />') + resp.body = b'<input type="submit" value="OK" />' elif req.path_info.startswith('/html'): - resp.body = b('<html><p>Success</p></html>') + resp.body = b'<html><p>Success</p></html>' else: resp.body = '' return resp(environ, start_response) @@ -23,9 +22,9 @@ req = Request(environ) response = Response() if req.method == 'GET': - response.body = b('<pre>Yeah !</pre>') + response.body = b'<pre>Yeah !</pre>' else: - response.body = b('<a href="/plop">Yeah !</a>') + response.body = b'<a href="/plop">Yeah !</a>' return response(environ, start_response) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/tests/compat.py new/pyquery-1.4.3/tests/compat.py --- old/pyquery-1.4.1/tests/compat.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/tests/compat.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -import sys - -PY3k = sys.version_info >= (3,) - -try: - unicode -except NameError: - unicode = str - -if PY3k: - text_type = str - - def b(value): - return value.encode('utf-8') -else: - text_type = unicode - - def b(value): # NOQA - return str(value) - -from unittest import TestCase # NOQA diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/tests/test_pyquery.py new/pyquery-1.4.3/tests/test_pyquery.py --- old/pyquery-1.4.1/tests/test_pyquery.py 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/tests/test_pyquery.py 2020-11-21 10:17:41.000000000 +0100 @@ -1,5 +1,3 @@ -# -*- coding:utf-8 -*- -# # Copyright (C) 2008 - Olivier Lauzanne <olauza...@gmail.com> # # Distributed under the BSD license, see LICENSE.txt @@ -11,19 +9,11 @@ from pyquery.openers import HAS_REQUEST from webtest import http from webtest.debugapp import debug_app -from .compat import PY3k -from .compat import b -from .compat import text_type -from .compat import TestCase +from unittest import TestCase sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) -def not_py3k(func): - if not PY3k: - return func - - dirname = os.path.dirname(os.path.abspath(__file__)) docs = os.path.join(os.path.dirname(dirname), 'docs') path_to_html_file = os.path.join(dirname, 'test.html') @@ -34,18 +24,9 @@ def test_unicode(self): xml = pq(u"<html><p>??</p></html>") - self.assertEqual(type(xml.html()), text_type) - if PY3k: - self.assertEqual(str(xml), '<html><p>??</p></html>') - self.assertEqual(str(xml('p:contains("??")')), '<p>??</p>') - else: - self.assertEqual(text_type(xml), - u"<html><p>??</p></html>") - self.assertEqual(str(xml), '<html><p>é</p></html>') - self.assertEqual(str(xml(u'p:contains("??")')), - '<p>é</p>') - self.assertEqual(text_type(xml(u'p:contains("??")')), - u'<p>??</p>') + self.assertEqual(type(xml.html()), str) + self.assertEqual(str(xml), '<html><p>??</p></html>') + self.assertEqual(str(xml('p:contains("??")')), '<p>??</p>') class TestAttributeCase(TestCase): @@ -159,7 +140,7 @@ """ def test_get_root(self): - doc = pq(b('<?xml version="1.0" encoding="UTF-8"?><root><p/></root>')) + doc = pq(b'<?xml version="1.0" encoding="UTF-8"?><root><p/></root>') self.assertEqual(isinstance(doc.root, etree._ElementTree), True) self.assertEqual(doc.encoding, 'UTF-8') @@ -803,14 +784,14 @@ def test_selector(self): expected = 'What' - d = pq(b(self.xml), parser='xml') + d = pq(self.xml.encode('utf8'), parser='xml') val = d('bar|blah', namespaces=self.namespaces).text() self.assertEqual(repr(val), repr(expected)) def test_selector_with_xml(self): expected = 'What' - d = pq('bar|blah', b(self.xml), parser='xml', + d = pq('bar|blah', self.xml.encode('utf8'), parser='xml', namespaces=self.namespaces) val = d.text() self.assertEqual(repr(val), repr(expected)) @@ -823,7 +804,7 @@ def test_xhtml_namespace(self): expected = 'What' - d = pq(b(self.xhtml), parser='xml') + d = pq(self.xhtml.encode('utf8'), parser='xml') d.xhtml_to_html() val = d('div').text() self.assertEqual(repr(val), repr(expected)) @@ -837,17 +818,19 @@ def test_remove_namespaces(self): expected = 'What' - d = pq(b(self.xml), parser='xml').remove_namespaces() + d = pq(self.xml.encode('utf8'), parser='xml').remove_namespaces() val = d('blah').text() self.assertEqual(repr(val), repr(expected)) def test_persistent_namespaces(self): - d = pq(b(self.xml), parser='xml', namespaces=self.namespaces) + d = pq(self.xml.encode('utf8'), parser='xml', + namespaces=self.namespaces) val = d('bar|blah').text() self.assertEqual(repr(val), repr('What')) def test_namespace_traversal(self): - d = pq(b(self.xml), parser='xml', namespaces=self.namespaces) + d = pq(self.xml.encode('utf8'), parser='xml', + namespaces=self.namespaces) val = d('baz|subbaz').closest('baz|baz').attr('a') self.assertEqual(repr(val), repr('b')) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyquery-1.4.1/tox.ini new/pyquery-1.4.3/tox.ini --- old/pyquery-1.4.1/tox.ini 2019-10-26 10:47:47.000000000 +0200 +++ new/pyquery-1.4.3/tox.ini 2020-11-21 10:17:41.000000000 +0100 @@ -1,5 +1,5 @@ [tox] -envlist=py27,py35,py36,py37 +envlist=py35,py36,py37 [testenv] whitelist_externals=