diff options
37 files changed, 151 insertions, 87 deletions
diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 83a5b985a..5ae20070b 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.5.0 +current_version = 2.5.1 commit = True message = Release v{new_version} tag = True diff --git a/.coveragerc b/.coveragerc index 7c4f7b218..cb0619b80 100644 --- a/.coveragerc +++ b/.coveragerc @@ -23,6 +23,3 @@ exclude_lines = [xml] output=coverage.xml - -[html] -show_contexts = True @@ -23,10 +23,8 @@ py-version=3.7 [MESSAGES CONTROL] enable=all disable=locally-disabled, - locally-enabled, suppressed-message, fixme, - no-self-use, cyclic-import, blacklisted-name, logging-format-interpolation, @@ -51,7 +49,6 @@ disable=locally-disabled, too-many-statements, too-few-public-methods, import-outside-toplevel, - bad-continuation, # This lint disagrees with Black consider-using-f-string, logging-fstring-interpolation, raise-missing-from, diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc index c64de266a..4c0e850d2 100644 --- a/doc/changelog.asciidoc +++ b/doc/changelog.asciidoc @@ -54,9 +54,27 @@ Changed rather than being a boolean: `none` (formerly `false`), `access` (formerly `true`) and `access-paste` (additionally allows pasting content, needed for websites like Photopea or GitHub Codespaces). +- The default `hints.selectors` now also match the `treeitem` ARIA roles. +- The `qutedmenu` userscript gained new `window` and `private` options. + +Fixed +~~~~~ + +- When the devtools are clicked but `input.insert_mode.auto_enter` is set to + `false`, insert mode now isn't entered anymore. + +[[v2.5.2]] +v2.5.2 (unreleased) +------------------- + +Fixed +~~~~~ + +- The `install` and `stacktrace` help pages are now included in the docs + shipped with qutebrowser when using the recommended packaging workflow. [[v2.5.1]] -v2.5.1 (unreleased) +v2.5.1 (2022-05-26) ------------------- Fixed @@ -70,11 +88,14 @@ Fixed the `qute://settings` page again. - Fixed issues with Chromium version detection on Archlinux with qt5-webengine 5.15.9-3. +- Fixed a rare possible crash with invalid `Content-Disposition` headers. - Fixes for various notification-related crashes: * With the `tiramisu` notification server (due to invalid behavior of the server, now a non-fatal error) * With the `budgie` notification server when closing a notification (due to invalid behavior of the server, now worked around) * When a server exits with an unsuccessful exit status (now a non-fatal error) * When a server couldn't be started successfully (now a non-fatal error) + * With the `herbe` notification presenter, when the website tries to close + the notification after the user accepting (right-clicking) it. - Fixes in userscripts: * The `qute-bitwarden` userscript now correctly searches for entries for sites on a subdomain of an unrecognized TLD. subdomain names. Previously diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index f43548629..1236dc3ac 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -3447,6 +3447,7 @@ Default: * +pass:[[role="menuitem"\]]+ * +pass:[[role="menuitemcheckbox"\]]+ * +pass:[[role="menuitemradio"\]]+ +* +pass:[[role="treeitem"\]]+ * +pass:[[ng-click\]]+ * +pass:[[ngClick\]]+ * +pass:[[data-ng-click\]]+ diff --git a/doc/install.asciidoc b/doc/install.asciidoc index bb4e08f5a..0f44e5a91 100644 --- a/doc/install.asciidoc +++ b/doc/install.asciidoc @@ -48,7 +48,7 @@ instructions! Note you'll need some basic libraries to use the virtualenv-installed PyQt: ---- -# apt install --no-install-recommends git ca-certificates python3 python3-venv asciidoc libglib2.0-0 libgl1 libfontconfig1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 libdbus-1-3 libyaml-dev gcc python3-dev libnss3 +# apt install --no-install-recommends git ca-certificates python3 python3-venv asciidoc libglib2.0-0 libgl1 libfontconfig1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 libdbus-1-3 libyaml-dev gcc python3-dev libnss3 libasound2 ---- // FIXME not needed anymore? @@ -69,6 +69,12 @@ from January 2018 is packaged, with QtWebEngine 5.9 based on a Chromium from Jan 2017. It's recommended to either upgrade to Ubuntu 20.04 LTS or <<tox,install qutebrowser in a virtualenv>> with a newer PyQt/Qt binary instead. +Note you'll need some basic libraries to use the virtualenv-installed PyQt: + +---- +# apt install --no-install-recommends git ca-certificates python3 python3-venv asciidoc libglib2.0-0 libgl1 libfontconfig1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 libdbus-1-3 libyaml-dev gcc python3-dev libnss3 libasound2 +---- + Ubuntu 20.04 LTS / Linux Mint 20 (or newer) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/misc/org.qutebrowser.qutebrowser.appdata.xml b/misc/org.qutebrowser.qutebrowser.appdata.xml index a18511b73..f506bd5a8 100644 --- a/misc/org.qutebrowser.qutebrowser.appdata.xml +++ b/misc/org.qutebrowser.qutebrowser.appdata.xml @@ -44,6 +44,7 @@ </content_rating> <releases> <!-- Add new releases here --> +<release version="2.5.1" date="2022-05-26"/> <release version="2.5.0" date="2022-04-01"/> <release version="2.4.0" date="2021-10-21"/> <release version="2.3.1" date="2021-07-28"/> diff --git a/misc/requirements/requirements-check-manifest.txt b/misc/requirements/requirements-check-manifest.txt index 1cdbb4863..c51ef3d0e 100644 --- a/misc/requirements/requirements-check-manifest.txt +++ b/misc/requirements/requirements-check-manifest.txt @@ -1,6 +1,6 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -build==0.7.0 +build==0.8.0 check-manifest==0.48 packaging==21.3 pep517==0.12.0 diff --git a/misc/requirements/requirements-dev.txt b/misc/requirements/requirements-dev.txt index ae57ae1f9..e4e768353 100644 --- a/misc/requirements/requirements-dev.txt +++ b/misc/requirements/requirements-dev.txt @@ -1,9 +1,9 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py bleach==5.0.0 -build==0.7.0 +build==0.8.0 bump2version==1.0.1 -certifi==2022.5.18 +certifi==2022.5.18.1 cffi==1.15.0 charset-normalizer==2.0.12 commonmark==0.9.1 @@ -12,13 +12,13 @@ docutils==0.18.1 github3.py==3.2.0 hunter==3.4.3 idna==3.3 -importlib-metadata==4.11.3 +importlib-metadata==4.11.4 jeepney==0.8.0 -keyring==23.5.0 +keyring==23.6.0 manhole==1.8.0 packaging==21.3 pep517==0.12.0 -pkginfo==1.8.2 +pkginfo==1.8.3 ply==3.11 pycparser==2.21 Pygments==2.12.0 @@ -28,16 +28,16 @@ pyparsing==3.0.9 PyQt-builder==1.12.2 python-dateutil==2.8.2 readme-renderer==35.0 -requests==2.27.1 +requests==2.28.0 requests-toolbelt==0.9.1 rfc3986==2.0.0 -rich==12.4.1 +rich==12.4.4 SecretStorage==3.3.2 sip==6.6.1 six==1.16.0 toml==0.10.2 tomli==2.0.1 -twine==4.0.0 +twine==4.0.1 typing_extensions==4.2.0 uritemplate==4.1.1 # urllib3==1.26.9 diff --git a/misc/requirements/requirements-flake8.txt b/misc/requirements/requirements-flake8.txt index db9dad8e2..217089191 100644 --- a/misc/requirements/requirements-flake8.txt +++ b/misc/requirements/requirements-flake8.txt @@ -12,13 +12,12 @@ flake8-docstrings==1.6.0 flake8-future-import==0.4.6 flake8-mock==0.3 flake8-plugin-utils==1.3.2 -flake8-polyfill==1.0.2 flake8-pytest-style==1.6.0 flake8-string-format==0.3.0 flake8-tidy-imports==4.8.0 flake8-tuple==0.4.1 mccabe==0.6.1 -pep8-naming==0.12.1 +pep8-naming==0.13.0 pycodestyle==2.8.0 pydocstyle==6.1.1 pyflakes==2.4.0 diff --git a/misc/requirements/requirements-mypy.txt b/misc/requirements/requirements-mypy.txt index 2f62bf818..a4b555cf3 100644 --- a/misc/requirements/requirements-mypy.txt +++ b/misc/requirements/requirements-mypy.txt @@ -2,17 +2,17 @@ chardet==4.0.0 diff-cover==6.5.0 -importlib-metadata==4.11.3 +importlib-metadata==4.11.4 importlib-resources==5.7.1 Jinja2==3.1.2 -lxml==4.8.0 +lxml==4.9.0 MarkupSafe==2.1.1 -mypy==0.950 +mypy==0.961 mypy-extensions==0.4.3 pluggy==1.0.0 Pygments==2.12.0 PyQt5-stubs==5.15.6.0 tomli==2.0.1 -types-PyYAML==6.0.7 +types-PyYAML==6.0.8 typing_extensions==4.2.0 zipp==3.8.0 diff --git a/misc/requirements/requirements-pyinstaller.txt b/misc/requirements/requirements-pyinstaller.txt index e290bad7a..35e65b6da 100644 --- a/misc/requirements/requirements-pyinstaller.txt +++ b/misc/requirements/requirements-pyinstaller.txt @@ -2,4 +2,4 @@ altgraph==0.17.2 pyinstaller==5.1 -pyinstaller-hooks-contrib==2022.5 +pyinstaller-hooks-contrib==2022.7 diff --git a/misc/requirements/requirements-pylint.txt b/misc/requirements/requirements-pylint.txt index 389a4bd95..38231fa12 100644 --- a/misc/requirements/requirements-pylint.txt +++ b/misc/requirements/requirements-pylint.txt @@ -1,28 +1,29 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py astroid==2.11.5 -certifi==2022.5.18 +certifi==2022.5.18.1 cffi==1.15.0 charset-normalizer==2.0.12 cryptography==37.0.2 -dill==0.3.4 +dill==0.3.5.1 future==0.18.2 github3.py==3.2.0 idna==3.3 isort==5.10.1 lazy-object-proxy==1.7.1 mccabe==0.7.0 -pefile==2021.9.3 +pefile==2022.5.30 platformdirs==2.5.2 pycparser==2.21 PyJWT==2.4.0 -pylint==2.13.9 +pylint==2.14.1 python-dateutil==2.8.2 ./scripts/dev/pylint_checkers -requests==2.27.1 +requests==2.28.0 six==1.16.0 tomli==2.0.1 -typed-ast==1.5.3 ; python_version<"3.8" +tomlkit==0.11.0 +typed-ast==1.5.4 ; python_version<"3.8" typing_extensions==4.2.0 uritemplate==4.1.1 # urllib3==1.26.9 diff --git a/misc/requirements/requirements-pyroma.txt b/misc/requirements/requirements-pyroma.txt index 9c5c82e37..382418dd9 100644 --- a/misc/requirements/requirements-pyroma.txt +++ b/misc/requirements/requirements-pyroma.txt @@ -1,7 +1,7 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py -build==0.7.0 -certifi==2022.5.18 +build==0.8.0 +certifi==2022.5.18.1 charset-normalizer==2.0.12 docutils==0.18.1 idna==3.3 @@ -10,6 +10,6 @@ pep517==0.12.0 Pygments==2.12.0 pyparsing==3.0.9 pyroma==4.0 -requests==2.27.1 +requests==2.28.0 tomli==2.0.1 urllib3==1.26.9 diff --git a/misc/requirements/requirements-sphinx.txt b/misc/requirements/requirements-sphinx.txt index ba9b7a14a..f100b6dc0 100644 --- a/misc/requirements/requirements-sphinx.txt +++ b/misc/requirements/requirements-sphinx.txt @@ -2,21 +2,21 @@ alabaster==0.7.12 Babel==2.10.1 -certifi==2022.5.18 +certifi==2022.5.18.1 charset-normalizer==2.0.12 -docutils==0.17.1 +docutils==0.18.1 idna==3.3 imagesize==1.3.0 -importlib-metadata==4.11.3 +importlib-metadata==4.11.4 Jinja2==3.1.2 MarkupSafe==2.1.1 packaging==21.3 Pygments==2.12.0 pyparsing==3.0.9 pytz==2022.1 -requests==2.27.1 +requests==2.28.0 snowballstemmer==2.2.0 -Sphinx==4.5.0 +Sphinx==5.0.1 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 diff --git a/misc/requirements/requirements-tests.txt b/misc/requirements/requirements-tests.txt index f3315fb4a..3e9f3233d 100644 --- a/misc/requirements/requirements-tests.txt +++ b/misc/requirements/requirements-tests.txt @@ -2,19 +2,20 @@ attrs==21.4.0 beautifulsoup4==4.11.1 -certifi==2022.5.18 +certifi==2022.5.18.1 charset-normalizer==2.0.12 cheroot==8.6.0 click==8.1.3 -coverage==6.3.3 +coverage==6.4.1 +exceptiongroup==1.0.0rc8 execnet==1.9.0 -filelock==3.7.0 +filelock==3.7.1 Flask==2.1.2 glob2==0.7 hunter==3.4.3 -hypothesis==6.46.7 +hypothesis==6.47.2 idna==3.3 -importlib-metadata==4.11.3 +importlib-metadata==4.11.4 iniconfig==1.1.1 itsdangerous==2.1.2 jaraco.functools==3.5.0 @@ -44,7 +45,7 @@ pytest-rerunfailures==10.2 pytest-xdist==2.5.0 pytest-xvfb==2.0.0 PyVirtualDisplay==3.0 -requests==2.27.1 +requests==2.28.0 requests-file==1.5.1 six==1.16.0 sortedcontainers==2.4.0 @@ -53,6 +54,6 @@ tldextract==3.3.0 toml==0.10.2 tomli==2.0.1 urllib3==1.26.9 -vulture==2.3 +vulture==2.4 Werkzeug==2.1.2 zipp==3.8.0 diff --git a/misc/requirements/requirements-tox.txt b/misc/requirements/requirements-tox.txt index 43583db6f..533e91e82 100644 --- a/misc/requirements/requirements-tox.txt +++ b/misc/requirements/requirements-tox.txt @@ -1,14 +1,14 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py distlib==0.3.4 -filelock==3.7.0 +filelock==3.7.1 packaging==21.3 -pip==22.1 +pip==22.1.2 platformdirs==2.5.2 pluggy==1.0.0 py==1.11.0 pyparsing==3.0.9 -setuptools==62.3.2 +setuptools==62.3.4 six==1.16.0 toml==0.10.2 tox==3.25.0 diff --git a/misc/requirements/requirements-vulture.txt b/misc/requirements/requirements-vulture.txt index 433500bf0..ac5016c99 100644 --- a/misc/requirements/requirements-vulture.txt +++ b/misc/requirements/requirements-vulture.txt @@ -1,4 +1,4 @@ # This file is automatically generated by scripts/dev/recompile_requirements.py toml==0.10.2 -vulture==2.3 +vulture==2.4 diff --git a/misc/userscripts/qutedmenu b/misc/userscripts/qutedmenu index bdd0d9b27..7f326916b 100755 --- a/misc/userscripts/qutedmenu +++ b/misc/userscripts/qutedmenu @@ -48,6 +48,8 @@ url=${url/*http/http} [[ -z $url ]] && exit 0 case $1 in - open) printf '%s' "open $url" >> "$QUTE_FIFO" || qutebrowser "$url" ;; - tab) printf '%s' "open -t $url" >> "$QUTE_FIFO" || qutebrowser "$url" ;; + open) printf '%s' "open $url" >> "$QUTE_FIFO" || qutebrowser "$url" ;; + tab) printf '%s' "open -t $url" >> "$QUTE_FIFO" || qutebrowser "$url" ;; + window) printf '%s' "open -w $url" >> "$QUTE_FIFO" || qutebrowser "$url --target window" ;; + private) printf '%s' "open -p $url" >> "$QUTE_FIFO" || qutebrowser "$url --target private-window" ;; esac diff --git a/misc/userscripts/readability-js b/misc/userscripts/readability-js index 485957ddb..752b759bb 100755 --- a/misc/userscripts/readability-js +++ b/misc/userscripts/readability-js @@ -59,9 +59,6 @@ const HEADER = ` width: 100%; margin: 0 0; } - a.reader-title { - color: #FFFFFF !important; - } img { max-width:100%; height:auto; diff --git a/qutebrowser/__init__.py b/qutebrowser/__init__.py index c38435242..75d4e0532 100644 --- a/qutebrowser/__init__.py +++ b/qutebrowser/__init__.py @@ -26,7 +26,7 @@ __copyright__ = "Copyright 2014-2021 Florian Bruhin (The Compiler)" __license__ = "GPL" __maintainer__ = __author__ __email__ = "mail@qutebrowser.org" -__version__ = "2.5.0" +__version__ = "2.5.1" __version_info__ = tuple(int(part) for part in __version__.split('.')) __description__ = "A keyboard-driven, vim-like browser based on Python and Qt." diff --git a/qutebrowser/browser/inspector.py b/qutebrowser/browser/inspector.py index 5908890ba..0eafa0536 100644 --- a/qutebrowser/browser/inspector.py +++ b/qutebrowser/browser/inspector.py @@ -29,7 +29,7 @@ from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, QEvent from PyQt5.QtGui import QCloseEvent from qutebrowser.browser import eventfilter -from qutebrowser.config import configfiles +from qutebrowser.config import configfiles, config from qutebrowser.utils import log, usertypes from qutebrowser.keyinput import modeman from qutebrowser.misc import miscwidgets @@ -137,7 +137,8 @@ class AbstractWebInspector(QWidget): @pyqtSlot() def _on_clicked(self) -> None: """Enter insert mode if a docked inspector was clicked.""" - if self._position != Position.window: + if (self._position != Position.window and + config.val.input.insert_mode.auto_enter): modeman.enter(self._win_id, usertypes.KeyMode.insert, reason='Inspector clicked', only_if_normal=True) diff --git a/qutebrowser/browser/webengine/notification.py b/qutebrowser/browser/webengine/notification.py index e4ad4d763..3571bb24d 100644 --- a/qutebrowser/browser/webengine/notification.py +++ b/qutebrowser/browser/webengine/notification.py @@ -621,18 +621,19 @@ class HerbeNotificationAdapter(AbstractNotificationAdapter): so there's no point. """ if status == QProcess.CrashExit: - return - - if code == 0: + pass + elif code == 0: self.click_id.emit(pid) elif code == 2: - self.close_id.emit(pid) + pass else: proc = self.sender() assert isinstance(proc, QProcess), proc stderr = proc.readAllStandardError() raise Error(f'herbe exited with status {code}: {stderr}') + self.close_id.emit(pid) + @pyqtSlot(QProcess.ProcessError) def _on_error(self, error: QProcess.ProcessError) -> None: if error == QProcess.Crashed: diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index 15729ccdc..0a2333afc 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -93,9 +93,7 @@ class WebEnginePrinting(browsertab.AbstractPrinting): def to_pdf(self, filename): self._widget.page().printToPdf(filename) - def to_printer(self, printer, callback=None): - if callback is None: - callback = lambda _ok: None + def to_printer(self, printer, callback=lambda ok: None): self._widget.page().print(printer, callback) diff --git a/qutebrowser/browser/webkit/http.py b/qutebrowser/browser/webkit/http.py index d13471277..a38cd358a 100644 --- a/qutebrowser/browser/webkit/http.py +++ b/qutebrowser/browser/webkit/http.py @@ -89,13 +89,16 @@ class ContentDisposition: try: parsed = reg('Content-Disposition', decoded) except IndexError: # pragma: no cover - # WORKAROUND for https://bugs.python.org/issue37491 + # WORKAROUND for https://github.com/python/cpython/issues/81672 # Fixed in Python 3.7.5 and 3.8.0. # Still getting failures on 3.10 on CI though raise ContentDispositionError("Missing closing quote character") except ValueError: # pragma: no cover - # WORKAROUND for https://bugs.python.org/issue42946 + # WORKAROUND for https://github.com/python/cpython/issues/87112 raise ContentDispositionError("Non-ASCII digit") + except AttributeError: + # WORKAROUND for https://github.com/python/cpython/issues/93010 + raise ContentDispositionError("Section number has an invalid leading 0") if parsed.defects: defects = list(parsed.defects) diff --git a/qutebrowser/completion/completer.py b/qutebrowser/completion/completer.py index b94077c6d..cf6984288 100644 --- a/qutebrowser/completion/completer.py +++ b/qutebrowser/completion/completer.py @@ -40,7 +40,8 @@ class CompletionInfo: """Context passed into all completion functions.""" config: config.Config - keyconf: config.KeyConfig # pylint: disable=used-before-assignment + # pylint: disable-next=used-before-assignment + keyconf: config.KeyConfig # type: ignore[name-defined] win_id: int cur_tab: 'browsertab.AbstractTab' @@ -164,6 +165,7 @@ class Completer(QObject): # cursor is in a space between two existing words parts.insert(i, '') prefix = [x.strip() for x in parts[:i]] + # pylint: disable-next=unnecessary-list-index-lookup center = parts[i].strip() # strip trailing whitespace included as a separate token postfix = [x.strip() for x in parts[i+1:] if not x.isspace()] diff --git a/qutebrowser/completion/models/configmodel.py b/qutebrowser/completion/models/configmodel.py index 7c8473b3f..6c85fbb29 100644 --- a/qutebrowser/completion/models/configmodel.py +++ b/qutebrowser/completion/models/configmodel.py @@ -44,16 +44,22 @@ def customized_option(*, info): def list_option(*, info): """A CompletionModel filled with settings whose values are lists.""" - predicate = lambda opt: (isinstance(info.config.get_obj(opt.name), - list) and not opt.no_autoconfig) - return _option(info, "List options", predicate) + return _option( + info, + "List options", + lambda opt: (isinstance(info.config.get_obj(opt.name), list) and + not opt.no_autoconfig) + ) def dict_option(*, info): """A CompletionModel filled with settings whose values are dicts.""" - predicate = lambda opt: (isinstance(info.config.get_obj(opt.name), - dict) and not opt.no_autoconfig) - return _option(info, "Dict options", predicate) + return _option( + info, + "Dict options", + lambda opt: (isinstance(info.config.get_obj(opt.name), dict) and + not opt.no_autoconfig) + ) def _option(info, title, predicate): diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 2ccb520b3..e91d9aaf1 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1685,6 +1685,7 @@ hints.selectors: - '[role="menuitem"]' - '[role="menuitemcheckbox"]' - '[role="menuitemradio"]' + - '[role="treeitem"]' - '[ng-click]' - '[ngClick]' - '[data-ng-click]' diff --git a/requirements.txt b/requirements.txt index 228d637a1..129fe402a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ adblock==0.5.2 colorama==0.4.4 -importlib-metadata==4.11.3 ; python_version=="3.7.*" +importlib-metadata==4.11.4 ; python_version=="3.7.*" importlib-resources==5.7.1 ; python_version=="3.7.*" or python_version=="3.8.*" Jinja2==3.1.2 MarkupSafe==2.1.1 diff --git a/scripts/asciidoc2html.py b/scripts/asciidoc2html.py index 6b4e3fb0d..ba8493247 100755 --- a/scripts/asciidoc2html.py +++ b/scripts/asciidoc2html.py @@ -43,7 +43,10 @@ class AsciiDoc: """Abstraction of an asciidoc subprocess.""" - FILES = ['faq', 'changelog', 'contributing', 'quickstart', 'userscripts'] + FILES = [ + 'faq', 'changelog', 'contributing', 'quickstart', 'userscripts', + 'install', 'stacktrace' + ] def __init__(self, asciidoc: Optional[str], diff --git a/scripts/dev/changelog_urls.json b/scripts/dev/changelog_urls.json index 0b6b071c5..6b33f15ef 100644 --- a/scripts/dev/changelog_urls.json +++ b/scripts/dev/changelog_urls.json @@ -1,6 +1,7 @@ { "pyparsing": "https://github.com/pyparsing/pyparsing/blob/master/CHANGES", - "pylint": "https://pylint.pycqa.org/en/latest/whatsnew/changelog.html", + "pylint": "https://pylint.pycqa.org/en/latest/whatsnew/2/index.html", + "tomlkit": "https://github.com/sdispater/tomlkit/blob/master/CHANGELOG.md", "dill": "https://github.com/uqfoundation/dill/commits/master", "isort": "https://pycqa.github.io/isort/CHANGELOG/", "lazy-object-proxy": "https://github.com/ionelmc/python-lazy-object-proxy/blob/master/CHANGELOG.rst", @@ -13,7 +14,7 @@ "execnet": "https://execnet.readthedocs.io/en/latest/changelog.html", "pytest-rerunfailures": "https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst", "pytest-repeat": "https://github.com/pytest-dev/pytest-repeat/blob/master/CHANGES.rst", - "requests": "https://github.com/psf/requests/blob/master/HISTORY.md", + "requests": "https://github.com/psf/requests/blob/main/HISTORY.md", "requests-file": "https://github.com/dashea/requests-file/blob/master/CHANGES.rst", "Werkzeug": "https://werkzeug.palletsprojects.com/en/latest/changes/", "click": "https://click.palletsprojects.com/en/latest/changes/", @@ -25,6 +26,7 @@ "Mako": "https://docs.makotemplates.org/en/latest/changelog.html", "glob2": "https://github.com/miracle2k/python-glob2/blob/master/CHANGES", "hypothesis": "https://hypothesis.readthedocs.io/en/latest/changes.html", + "exceptiongroup": "https://github.com/agronholm/exceptiongroup/blob/main/CHANGES.rst", "mypy": "https://mypy-lang.blogspot.com/", "types-PyYAML": "https://github.com/python/typeshed/commits/master/stubs/PyYAML", "pytest": "https://docs.pytest.org/en/latest/changelog.html", @@ -51,7 +53,6 @@ "flake8-deprecated": "https://github.com/gforcada/flake8-deprecated/blob/master/CHANGES.rst", "flake8-future-import": "https://github.com/xZise/flake8-future-import#changes", "flake8-mock": "https://github.com/aleGpereira/flake8-mock#changes", - "flake8-polyfill": "https://gitlab.com/pycqa/flake8-polyfill/-/blob/master/CHANGELOG.rst", "flake8-string-format": "https://github.com/xZise/flake8-string-format#changes", "flake8-plugin-utils": "https://github.com/afonasev/flake8-plugin-utils#change-log", "flake8-pytest-style": "https://github.com/m-burst/flake8-pytest-style#change-log", diff --git a/scripts/dev/run_pylint_on_tests.py b/scripts/dev/run_pylint_on_tests.py index 28c6e32c9..e044de976 100644 --- a/scripts/dev/run_pylint_on_tests.py +++ b/scripts/dev/run_pylint_on_tests.py @@ -64,6 +64,8 @@ def main(): 'import-error', # tests/helpers imports 'wrong-import-order', + # __tracebackhide__ + 'unnecessary-lambda-assignment', ] toxinidir = sys.argv[1] diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py index febd2bf8a..1267a278a 100755 --- a/scripts/dev/src2asciidoc.py +++ b/scripts/dev/src2asciidoc.py @@ -176,13 +176,15 @@ def _get_setting_quickref(): def _get_configtypes(): """Get configtypes classes to document.""" - predicate = lambda e: ( - inspect.isclass(e) and - # pylint: disable=protected-access - e not in [configtypes.BaseType, configtypes.MappingType, - configtypes._Numeric, configtypes.FontBase] and - # pylint: enable=protected-access - issubclass(e, configtypes.BaseType)) + def predicate(e): + return ( + inspect.isclass(e) and + # pylint: disable=protected-access + e not in [configtypes.BaseType, configtypes.MappingType, + configtypes._Numeric, configtypes.FontBase] and + # pylint: enable=protected-access + issubclass(e, configtypes.BaseType) + ) yield from inspect.getmembers(configtypes, predicate) diff --git a/tests/unit/browser/webkit/http/test_http.py b/tests/unit/browser/webkit/http/test_http.py index 4db78f4ff..d50f1c277 100644 --- a/tests/unit/browser/webkit/http/test_http.py +++ b/tests/unit/browser/webkit/http/test_http.py @@ -44,6 +44,21 @@ def test_no_content_disposition(stubs, url, expected): assert filename == expected +@pytest.mark.parametrize('value', [ + # https://github.com/python/cpython/issues/87112 + 'inline; 0*²'.encode("iso-8859-1"), + # https://github.com/python/cpython/issues/81672 + b'"', + # https://github.com/python/cpython/issues/93010 + b'attachment; 0*00="foo"', + # FIXME: Should probably have more tests if this is still relevant after + # dropping QtWebKit. +]) +def test_parse_content_disposition_invalid(value): + with pytest.raises(http.ContentDispositionError): + http.ContentDisposition.parse(value) + + @pytest.mark.parametrize('template', [ '{}', 'attachment; filename="{}"', diff --git a/tests/unit/browser/webkit/test_webkitelem.py b/tests/unit/browser/webkit/test_webkitelem.py index f7cc3e8c2..7df91922d 100644 --- a/tests/unit/browser/webkit/test_webkitelem.py +++ b/tests/unit/browser/webkit/test_webkitelem.py @@ -195,6 +195,7 @@ class SelectionAndFilterTests: ('<p role="menuitem" foo="bar"/>', ['all']), ('<p role="menuitemcheckbox" foo="bar"/>', ['all']), ('<p role="menuitemradio" foo="bar"/>', ['all']), + ('<p role="treeitem" foo="bar"/>', ['all']), ('<p role="button" foo="bar"/>', ['all']), ('<p role="button" href="bar"/>', ['all', 'url']), diff --git a/tests/unit/utils/test_log.py b/tests/unit/utils/test_log.py index bbc6b02db..20938d6fb 100644 --- a/tests/unit/utils/test_log.py +++ b/tests/unit/utils/test_log.py @@ -236,6 +236,7 @@ class TestInitLog: """Tests for init_log.""" def _get_default_args(self): + # pylint: disable-next=unused-variable return argparse.Namespace(debug=True, loglevel='debug', color=True, loglines=10, logfilter=None, force_color=False, json_logging=False, diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index 7b616d8b7..64df0ece2 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -1463,7 +1463,11 @@ def test_uptime(monkeypatch, qapp): monkeypatch.setattr(qapp, "launch_time", launch_time, raising=False) class FakeDateTime(datetime.datetime): - now = lambda x=datetime.datetime(1, 1, 1, 1, 1, 1, 2): x + + @classmethod + def now(cls, tz=None): + return datetime.datetime(1, 1, 1, 1, 1, 1, 2) + monkeypatch.setattr(datetime, 'datetime', FakeDateTime) uptime_delta = version._uptime() |