After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748813 - make() got an unexpected keyword argument 'name'
make() got an unexpected keyword argument 'name'
Status: RESOLVED FIXED
Product: gaupol
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gaupol-maint@gnome.bugs
gaupol-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2015-05-03 00:26 UTC by Cilyan Olowen
Modified: 2015-05-03 20:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Cilyan Olowen 2015-05-03 00:26:44 UTC
Traceback

File: /usr/lib/python3.4/site-packages/gaupol/agents/video.py
Line: 138
In: _on_load_video_activate

    self._init_player_widgets()

File: /usr/lib/python3.4/site-packages/gaupol/agents/video.py
Line: 61
In: _init_player_widgets

    self.player = gaupol.VideoPlayer()

File: /usr/lib/python3.4/site-packages/gaupol/player.py
Line: 76
In: __init__

    self._init_text_overlay()

File: /usr/lib/python3.4/site-packages/gaupol/player.py
Line: 206
In: _init_text_overlay

    self._text_overlay = Gst.ElementFactory.make("textoverlay", name=None)

TypeError: make() got an unexpected keyword argument 'name'

Environment

Platform: Linux-4.0.0-2-ARCH-x86_64-with-arch
Locale: fr_FR.utf_8

Libraries

Python: 3.4.3
GTK+: 3.16.2
PyGObject: 3.16.1
GStreamer: 1.4.5.0

Python Packages

aeidon: 0.28
gaupol: 0.28
enchant: None
chardet: None
Comment 1 Osmo Salomaa 2015-05-03 00:47:07 UTC
This looks like a duplicate of bug #747734, but before I mark it as such and close, as this is no longer an individual case, I'll ask, do you have this python-gst/gst-python installed, and if so, why? I'm having trouble understading what this package is that changes the GStreamer API or why do people have it installed, especially for Python 3, where unaltered GObject introspection bindings should be the thing to use.
Comment 2 Cilyan Olowen 2015-05-03 01:38:20 UTC
It seems it is brought by Pitivi. Not sure why it is needed. It overrides the gi API in some way. Shame it disturbs other vanilla Python Gst applications. :s (Pitivi never worked by the way. Maybe that's one of the reasons.)

$ LANG=C pacman -Qi gst-python
Name           : gst-python
Version        : 1.4.0-3
Description    : Python bindings for GStreamer
Architecture   : x86_64
URL            : http://gstreamer.freedesktop.org/
Licenses       : LGPL
Groups         : None
Provides       : None
Depends On     : python-gobject  gst-plugins-base
Optional Deps  : None
Required By    : pitivi
Optional For   : None
Conflicts With : None
Replaces       : None
Installed Size : 106.00 KiB
Packager       : Felix Yan <felixonmars@archlinux.org>
Build Date     : Sat Mar 28 09:57:28 2015
Install Date   : Sat Apr 25 16:33:46 2015
Install Reason : Explicitly installed
Install Script : No
Validated By   : Signature

$ LANG=C pacman -Ql gst-python
gst-python /usr/
gst-python /usr/lib/
gst-python /usr/lib/gstreamer-1.0/
gst-python /usr/lib/gstreamer-1.0/libgstpythonplugin.so
gst-python /usr/lib/python3.4/
gst-python /usr/lib/python3.4/site-packages/
gst-python /usr/lib/python3.4/site-packages/gi/
gst-python /usr/lib/python3.4/site-packages/gi/overrides/
gst-python /usr/lib/python3.4/site-packages/gi/overrides/Gst.py
gst-python /usr/lib/python3.4/site-packages/gi/overrides/GstPbutils.py
gst-python /usr/lib/python3.4/site-packages/gi/overrides/__pycache__/
gst-python /usr/lib/python3.4/site-packages/gi/overrides/__pycache__/Gst.cpython-34.pyc
gst-python /usr/lib/python3.4/site-packages/gi/overrides/__pycache__/Gst.cpython-34.pyo
gst-python /usr/lib/python3.4/site-packages/gi/overrides/__pycache__/GstPbutils.cpython-34.pyc
gst-python /usr/lib/python3.4/site-packages/gi/overrides/__pycache__/GstPbutils.cpython-34.pyo
gst-python /usr/lib/python3.4/site-packages/gi/overrides/_gi_gst.cpython-34m.so
$
Comment 3 Cilyan Olowen 2015-05-03 02:00:02 UTC
Here is the offending code in Gst.py. Very frustrating how they did not keep the original name...

class ElementFactory(Gst.ElementFactory):

    # ElementFactory
    def get_longname(self):
        return self.get_metadata("long-name")

    def get_description(self):
        return self.get_metadata("description")

    def get_klass(self):
        return self.get_metadata("klass")

    @classmethod
    def make(cls, factory_name, instance_name=None):
        return Gst.ElementFactory.make(factory_name, instance_name)

http://cgit.freedesktop.org/gstreamer/gst-python/tree/gi/overrides/Gst.py#n215

I removed first all the "name=None" to make Gaupol work. Then I removed the offending packet together with Pitivi and it seems it still works with the "name=None" removed. It should also work by calling the function with positional arguments only. That would support both APIs.

Or that could be reported to the Gstreamer team. They always have been particularly helpful on the IRC.
Comment 4 Osmo Salomaa 2015-05-03 20:24:56 UTC
Thanks for looking into it.

Filed against gstreamer/gst-python:

https://bugzilla.gnome.org/show_bug.cgi?id=748852

Worked around in Gaupol:

commit c63754872818573967d52cd3052a7cd77ee5524b
Author: Osmo Salomaa <otsaloma@iki.fi>
Date:   Sun May 3 22:49:18 2015 +0300

    Use positional arguments with Gst.ElementFactory.make.
    
    To avoid a bad override in gst-python, which is not required by Gaupol,
    but if installed, affects Gaupol as well.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=748813

https://github.com/otsaloma/gaupol/commit/c63754872818573967d52cd3052a7cd77ee5524b