Python Webkit module no longer works in 17.10

Bug #1723576 reported by NoBugs!
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
webkit2gtk (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

On previous versions of Ubuntu you could use the WebKit GTK3 controls, on Ubuntu 17.10 I have the newer gir1.2-webkit2-4.0 and this same command I used to import WebKit module fails:

ubuntu@ubuntu:~/Downloads$ python
Python 2.7.14 (default, Sep 23 2017, 22:06:14)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> from gi.repository import WebKit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name WebKit
>>>

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: gir1.2-webkit2-4.0 2.18.0-2
ProcVersionSignature: Ubuntu 4.13.0-15.16-generic 4.13.4
Uname: Linux 4.13.0-15-generic x86_64
ApportVersion: 2.20.7-0ubuntu3
Architecture: amd64
CasperVersion: 1.385
CurrentDesktop: ubuntu:GNOME
Date: Sat Oct 14 04:45:22 2017
LiveMediaBuild: Ubuntu 17.10 "Artful Aardvark" - Beta amd64 (20171012)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=
 SHELL=/bin/bash
SourcePackage: webkit2gtk
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
NoBugs! (luke32j) wrote :
Revision history for this message
NoBugs! (luke32j) wrote :

It appears you are supposed to import "WebKit2" now, but this has a different api...

webview.set_highlight_text_matches is not a function for example.

Any chance we could have both versions compiled in?

Revision history for this message
dino99 (9d9) wrote :

Tested that:

>>> from gi.repository import WebKit2
__main__:1: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in webkit2gtk (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.