Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kazam not working on Python 3.5.3 #4

Open
SebaDA opened this issue Jun 30, 2017 · 11 comments
Open

Kazam not working on Python 3.5.3 #4

SebaDA opened this issue Jun 30, 2017 · 11 comments

Comments

@SebaDA
Copy link

SebaDA commented Jun 30, 2017

It seems tha Kazam is not working on Python 3.5

$ python3 -V
Python 3.5.3

Steps:

  1. Download kazam from https://launchpad.net/kazam/stable/1.4.5/+download/kazam-1.4.5.tar.gz
  2. Unpack
  3. Install with:
sudo python3 setup.py install
  1. Run kazam
$ kazam
/usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk
Traceback (most recent call last):
  File "/usr/bin/kazam", line 146, in <module>
    from kazam.app import KazamApp
  File "/usr/lib/python3.5/site-packages/kazam/app.py", line 35, in <module>
    from kazam.backend.prefs import *
  File "/usr/lib/python3.5/site-packages/kazam/backend/prefs.py", line 478, in <module>
    prefs = Prefs()
  File "/usr/lib/python3.5/site-packages/kazam/backend/prefs.py", line 121, in __init__
    self.read_config()
  File "/usr/lib/python3.5/site-packages/kazam/backend/prefs.py", line 199, in read_config
    self.audio_source = int(self.config.get("main", "audio_source"))
  File "/usr/lib/python3.5/site-packages/kazam/backend/config.py", line 103, in get
    return ConfigParser.get(self, section, key)
  File "/usr/lib64/python3.5/configparser.py", line 797, in get
    d)
  File "/usr/lib64/python3.5/configparser.py", line 393, in before_get
    self._interpolate_some(parser, option, L, value, section, defaults, 1)
  File "/usr/lib64/python3.5/configparser.py", line 406, in _interpolate_some
    rawval = parser.get(section, option, raw=True, fallback=rest)
TypeError: get() got an unexpected keyword argument 'raw'
@kholyphoenix1
Copy link

My problem too...'

@RaviTezu
Copy link

RaviTezu commented Nov 2, 2017

I am seeing the same problem on Ubuntu 17.10:

λ Neutron ~ → python3 -V
Python 3.6.3
λ Neutron ~ → kazam -v
/usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
kazam 1.4.5 'NCC-80102'
λ Neutron ~ → kazam
/usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
/usr/lib/python3/dist-packages/kazam/frontend/window_area.py:30: PyGIWarning: Wnck was imported without specifying a version first. Use gi.require_version('Wnck', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, GObject, Gdk, Wnck, GdkX11
/usr/lib/python3/dist-packages/kazam/backend/gstreamer.py:35: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GObject, Gst
/usr/lib/python3/dist-packages/kazam/frontend/indicator.py:148: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
from gi.repository import AppIndicator3
/usr/lib/python3/dist-packages/kazam/frontend/indicator.py:97: PyGIWarning: Keybinder was imported without specifying a version first. Use gi.require_version('Keybinder', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Keybinder
[1] 7891 segmentation fault (core dumped) kazam
λ Neutron ~ → cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.10
DISTRIB_CODENAME=artful
DISTRIB_DESCRIPTION="Ubuntu 17.10"

@thiagozs
Copy link

thiagozs commented Nov 7, 2017

+1

@RaviTezu
Copy link

RaviTezu commented Nov 7, 2017

On Ubuntu 17.10:
I switched to Xorg at the login prompt and everything started working fine then after.

@pojar
Copy link

pojar commented Nov 23, 2017

/usr/bin/kazam:32: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded. ...blah blah blah...

Open file

/usr/lib/python3/dist-packages/kazam/backend/config.py

find

def get(self, section, key): try: ret = ConfigParser.get(self, section, key)

and replace

def get(self, section, key,raw=True,fallback='rest'): try: return super(KazamConfig,self).get(section, key,raw=raw,fallback=fallback) ret = ConfigParser.get(self, section, key)

Try start Kazam.

@maximal
Copy link

maximal commented Dec 25, 2017

+1

Ubuntu 17.10, x64, Python 2.7.14

@maximal
Copy link

maximal commented Dec 25, 2017

@RaviTezu, seems like your error is not the same as the @SebaDA’s one (but I’m not sure, of course).

The surgical solution for you is in my answer to this StackExchange question:

https://askubuntu.com/questions/982233/kazam-fails-with-pygiwarning-gtk-was-imported-without-specifying-a-version-fir/989341#989341

@cutephoton
Copy link

Another solution is to modify the function prototype to pass extra arguments:

def get(self, section, key,raw=True,fallback='rest',**kwargs):

Then forward extra kwargs in the call:

ret = ConfigParser.get(self, section, key, **kwargs)

And per the previous suggestion I would simplify:

ret = super().get(self, section, key, **kwargs)

The additional arguments are not necessary for python 3. Both approaches are equivalent. The only advantage here is to avoid having to fix the same problem if the parameters change in the future.

cutephoton pushed a commit to cutephoton/kazam that referenced this issue Jan 2, 2018
The fix is to simply add kwargs to the function and pass them to the
super class.

See hzbd#4
@gustavklopp
Copy link

@cutephoton Nice fix! Why didn't you ask for a pull request?

@cutephoton
Copy link

Yeah, sorry about that -- I needed kazam for a project at the time and forgot about the fix. Looks like there's a pull request with a similar fix as of the last week.

Thank you for the positive feedback.

@OsmanKandemir
Copy link

JUST ADDING **KWARGS TO THE PARAMETERS WILL SOLVE THE PROBLEM.

1-Open file

/usr/lib/python3/dist-packages/kazam/backend/config.py

or

/usr/local/lib/python3.6/dist-packages/kazam/backend/config.py

2-Find this function

def get(self, section, key):

and replace

def get(self, section, key,**kwargs):

3-Find this return line

return ConfigParser.get(self, section, key)

and replace

return ConfigParser.get(self, section, key,**kwargs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants