Opened 4 years ago

Last modified 3 years ago

#62508 new defect

webkit2-gtk unusable gobject-introspection bindings

Reported by: elelay (Eric Le Lay) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc: dbevans (David B. Evans), cooljeanius (Eric Gallager), evanmiller (Evan Miller)
Port: webkit2-gtk

Description

I see the bug from python 3.

The typelib is loaded so the classes are found but the associated library can't be loaded because it's in the build, not prefix location. So instanciating the class produces TypeError: could not get a reference to type class

jojolapin@Mac-mini macports-ports % python3
Python 3.9.2 (default, Mar 18 2021, 05:43:47) 
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import WebKit2
<stdin>: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.
>>> WebKit2.\t
** (.:85635): WARNING **: 15:26:42.272: Failed to load shared library '/opt/local/var/macports/build/_Users_jojolapin_macports-ports_www_webkit2-gtk/webkit2-gtk/work/build/lib/libwebkit2gtk-4.0.37.dylib' referenced by the typelib: dlopen(/opt/local/var/macports/build/_Users_jojolapin_macports-ports_www_webkit2-gtk/webkit2-gtk/work/build/lib/libwebkit2gtk-4.0.37.dylib, 9): image not found

** (.:85635): WARNING **: 15:26:42.272: Failed to load shared library '/opt/local/var/macports/build/_Users_jojolapin_macports-ports_www_webkit2-gtk/webkit2-gtk/work/build/lib/libjavascriptcoregtk-4.0.18.dylib' referenced by the typelib: dlopen(/opt/local/var/macports/build/_Users_jojolapin_macports-ports_www_webkit2-gtk/webkit2-gtk/work/build/lib/libjavascriptcoregtk-4.0.18.dylib, 9): image not found

Display all 223 possibilities? (y or n) 
WebKit2.ApplicationInfo(                                    WebKit2.get_major_version(                                  WebKit2.ScriptDialog(                                      
(....snip....)
>>> WebKit2.UserContentManager
<class 'gi.repository.WebKit2.UserContentManager'>
>>> WebKit2.UserContentManager()
<stdin>:1: Warning: cannot retrieve class for invalid (unclassed) type 'void'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: could not get a reference to type class
>>> WebKit2.WebView()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: could not get a reference to type class

Change History (5)

comment:1 Changed 4 years ago by elelay (Eric Le Lay)

Cc: dbevans kencu added

comment:2 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Probably yet another bug in gobject-introspection, or another expression of one of the existing bugs.

comment:3 Changed 4 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:4 Changed 3 years ago by evanmiller (Evan Miller)

Cc: evanmiller added

comment:5 Changed 3 years ago by kencu (Ken)

Cc: kencu removed
Note: See TracTickets for help on using tickets.