ValueError: Invalid section name: 'DEFAULT'

Bug #1797878 reported by TP
188
This bug affects 42 people
Affects Status Importance Assigned to Milestone
Kazam Screencaster
New
Undecided
Ei Shwe Khine

Bug Description

Cannot start kazam, it gives following output in terminal:

/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/bin/kazam:75: DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
  dist = platform.linux_distribution()
Traceback (most recent call last):
  File "/usr/bin/kazam", line 146, in <module>
    from kazam.app import KazamApp
  File "/usr/lib/python3.7/site-packages/kazam/app.py", line 35, in <module>
    from kazam.backend.prefs import *
  File "/usr/lib/python3.7/site-packages/kazam/backend/prefs.py", line 478, in <module>
    prefs = Prefs()
  File "/usr/lib/python3.7/site-packages/kazam/backend/prefs.py", line 119, in __init__
    self.config = KazamConfig()
  File "/usr/lib/python3.7/site-packages/kazam/backend/config.py", line 76, in __init__
    ConfigParser.__init__(self, self.DEFAULTS[0]['keys'])
  File "/usr/lib/python3.7/configparser.py", line 638, in __init__
    self._read_defaults(defaults)
  File "/usr/lib/python3.7/configparser.py", line 1216, in _read_defaults
    self.read_dict({self.default_section: defaults})
  File "/usr/lib/python3.7/configparser.py", line 753, in read_dict
    self.set(section, key, value)
  File "/usr/lib/python3.7/site-packages/kazam/backend/config.py", line 127, in set
    self.add_section(section)
  File "/usr/lib/python3.7/configparser.py", line 1205, in add_section
    super().add_section(section)
  File "/usr/lib/python3.7/configparser.py", line 655, in add_section
    raise ValueError('Invalid section name: %r' % section)
ValueError: Invalid section name: 'DEFAULT'

Manjaro 18.0.0-rc
Gnome 3.30.1

Revision history for this message
BlackMage (blackmage) wrote :

i have also the same bug under fedora 32 (rawhide)

Revision history for this message
BlackMage (blackmage) wrote :

but downloaded and installed with kazam-1.4.5.tar.gz

Revision history for this message
qrobinson (quincy-robinson) wrote :

Ditto comments #1 & #2
==

qrobinson@localhost 05Feb20 14:49:46EST :~/Downloads/kazam-1.4.5$ kazam&
[1] 372570
qrobinson@localhost 05Feb20 14:49:53EST :~/Downloads/kazam-1.4.5$ /usr/local/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/local/bin/kazam:75: DeprecationWarning: dist() and linux_distribution() functions are deprecated in Python 3.5
  dist = platform.linux_distribution()
Traceback (most recent call last):
  File "/usr/local/bin/kazam", line 146, in <module>
    from kazam.app import KazamApp
  File "/usr/local/lib/python3.7/site-packages/kazam/app.py", line 35, in <module>
    from kazam.backend.prefs import *
  File "/usr/local/lib/python3.7/site-packages/kazam/backend/prefs.py", line 478, in <module>
    prefs = Prefs()
  File "/usr/local/lib/python3.7/site-packages/kazam/backend/prefs.py", line 119, in __init__
    self.config = KazamConfig()
  File "/usr/local/lib/python3.7/site-packages/kazam/backend/config.py", line 76, in __init__
    ConfigParser.__init__(self, self.DEFAULTS[0]['keys'])
  File "/usr/lib64/python3.7/configparser.py", line 638, in __init__
    self._read_defaults(defaults)
  File "/usr/lib64/python3.7/configparser.py", line 1216, in _read_defaults
    self.read_dict({self.default_section: defaults})
  File "/usr/lib64/python3.7/configparser.py", line 753, in read_dict
    self.set(section, key, value)
  File "/usr/local/lib/python3.7/site-packages/kazam/backend/config.py", line 126, in set
    self.add_section(section)
  File "/usr/lib64/python3.7/configparser.py", line 1205, in add_section
    super().add_section(section)
  File "/usr/lib64/python3.7/configparser.py", line 655, in add_section
    raise ValueError('Invalid section name: %r' % section)
ValueError: Invalid section name: 'DEFAULT'

Revision history for this message
qrobinson (quincy-robinson) wrote :

These two workarounds enabled a build & install from kazam 1.4.5 tarball on Fedora

https://aur.archlinux.org/packages/kazam/#comment-660476
If you run into problem with ValueError: Invalid section name: 'DEFAULT' The fix is: edit the file "/usr/lib/python3.7/site-packages/kazam/backend/config.py" Replace line 77: ConfigParser.init(self, self.DEFAULTS[0]['keys'] with ConfigParser.init__(self) can fix this issue.

https://bugs.launchpad.net/kazam/+bug/1500083
**Workaround**
edit /usr/lib/python3/dist-packages/kazam/backend/config.py
locate the highlighted def get(self, section, key):
and modify to have:

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)

Revision history for this message
Pierre van Male (vmalep) wrote :

Solution #4 https://bugs.launchpad.net/kazam/+bug/1500083 does not work for me on a fresh Ubuntu Focal 20.04 install with Kazam version (1.5.3-0ubuntu3) installed.

Revision history for this message
Alejandro Arcos (aarcos) wrote :

Solution #4 https://bugs.launchpad.net/kazam/+bug/1500083 work for me!!!!, on debian 10.
DEBUG Kazam - Starting ...
DEBUG Kazam - Running on: debian 10.4
DEBUG Kazam - Kazam version: 1.4.5 NCC-80102
DEBUG Prefs - XDG_PICTURES is a directory and accessible
DEBUG Prefs-HW - Getting hardware specs
DEBUG Prefs-HW - Getting Video sources.
DEBUG Prefs-HW - Found 1 monitor(s).
DEBUG Prefs-HW - Monitor 0 - X: 0, Y: 0, W: 1366, H: 768
DEBUG Instant - Setting variables./usr/share/kazam/
DEBUG Grabber - Starting Grabber.
DEBUG Grabber - Grabber source: 0, 0, 1366, 768
DEBUG Instant - Grabbing screen
Failed to play sound: Sound disabled
DEBUG Grabber - Coordinates X 0 Y 0 W 1366 H 768
DEBUG Grabber - Adding cursor.
DEBUG Grabber - Cursor coords: 546 303

Thanks!!!!

description: updated
Revision history for this message
senya (senya) wrote :
Ei Shwe Khine (kira1995)
Changed in kazam:
assignee: nobody → Ei Shwe Khine (kira1995)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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