[PyQt] (no subject)

Phil Thompson phil at riverbankcomputing.com
Thu Nov 28 22:46:15 GMT 2019


On 28/11/2019 16:10, mid wrote:
> Hello, I'm trying to use QWebBrowserView in a program of mine, but any
> time I use it (setUrl, setHtml) it crashes and prints "Could not find
> QWebEngineProcess.exe". If I install Python to a completely ASCII path
> it works, but then Python crashes silently if I just close the window
> with a QWebEngineView in it.
> 
> The minimal reproduction steps are:
> - Install Python 3 (into a path which has Unicode content such as
> Cyrillic, in my case the username was Адміністратор)
> - python -m pip install pyqt5
> - python -m pip install pyqtwebengine
> - Interpret:
> 
>     from PyQt5.QtCore import QLibraryInfo
>     from PyQt5.QtWidgets import *
>     from PyQt5.QtWebEngineWidgets import QWebEngineView
>     import sys
> 
>     application = QApplication(sys.argv)
> 
>     print(QLibraryInfo.location(QLibraryInfo.LibraryExecutablesPath))
> 
>     window = QWidget()
>     window.resize(640, 480)
> 
>     browser = QWebEngineView(window)
>     browser.setHtml("<h1>booboohoohoo</h1>")
> 
>     window.show()
>     sys.exit(application.exec_())
> On Linux it works fine (probably because of my path being fully ASCII
> or because it's not Windows), but on Windows it prints the
> LibraryExecutablesPath (where the Unicode part is mangled) and then
> crashes with the message I mentioned above.
> 
> Are there any short-term fixes/ways to avoid this issue?
> 
> Sorry for any formatting errors, first time messaging a mailing list.

For the moment I'd forget WebEngine and instead try and work out why 
"the Unicode part is mangled". If possible write a C++ version that 
prints out the result returned by QLibraryInfo.location(). That should 
tell you if it is a Qt or PyQt problem.

Phil


More information about the PyQt mailing list