hzbd / kazam

A screencasting program created with design in mind.(https://launchpad.net/kazam)
GNU General Public License v3.0
314 stars 58 forks source link

Kazam not working on Python 3.5.3 #4

Open SebaDA opened 7 years ago

SebaDA commented 7 years ago

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 commented 7 years ago

My problem too...'

RaviTezu commented 7 years ago

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 commented 7 years ago

+1

RaviTezu commented 7 years ago

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

pojar commented 7 years ago

/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 commented 6 years ago

+1

Ubuntu 17.10, x64, Python 2.7.14

maximal commented 6 years ago

@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 commented 6 years ago

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.

gustavklopp commented 6 years ago

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

cutephoton commented 6 years ago

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 commented 3 years ago

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)