[PyQt] 5.11: TypeErrors with QWebEngineCookieStore::setCookieFilter

Florian Bruhin me at the-compiler.org
Mon Jun 11 09:32:58 BST 2018


Hey,

I've tried implementing a cookie filter with the Qt 5.11 snapshot
(sip-4.19.9.dev1806101717, PyQt5_gpl-5.11.dev1806101728, Qt 5.11.1
branch, GCC 8.1.1 on Archlinux).

When trying in my real application with a:

  store = QWebEngineProfile.defaultProfile().cookieStore()
  store.setCookieFilter(lambda _info: True)

I get:

  TypeError: a 'bool' is expected not 'generator'

I've tried to write a minimal example (attached), but that seems to work
fine. However, when I add the commented "print", I get:

  TypeError: 'managedbuffer' object is not callable

Not sure if that's the same issue, or two different issues?

Florian

-- 
https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
import sys

from PyQt5.QtCore import QUrl
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineProfile

def _filter(info):
    # print(info)
    return True

app = QApplication(sys.argv)
QWebEngineProfile.defaultProfile().cookieStore().setCookieFilter(_filter)
wv = QWebEngineView()
wv.load(QUrl("https://github.com/"))
wv.show()
app.exec_()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180611/54b0be2d/attachment.sig>


More information about the PyQt mailing list