pycentral fails if a package configuration file is empty

Bug #578410 reported by ooze
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-central (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: python-central

In some cases, a configuration file in the "/usr/share/pyshared-data" directory is empty or otherwise does not contain a "pycentral" section. This may due to a packaging bug, file system corruption, bad installation, etc. When running a package manager, this will cause an error and stop the process with an error similar to the following:

Traceback (most recent call last):
  File "/usr/bin/pycentral", line 2300, in <module>
    main()
  File "/usr/bin/pycentral", line 2294, in main
    rv = action.run(global_options)
  File "/usr/bin/pycentral", line 1654, in run
    pkg = DebPackage('package', self.args[0], oldstyle=False)
  File "/usr/bin/pycentral", line 380, in __init__
    self.read_pyfiles()
  File "/usr/bin/pycentral", line 413, in read_pyfiles
    self.pkgconfig.set('pycentral', 'include-links', '0')
  File "/usr/lib/python2.6/ConfigParser.py", line 669, in set
    ConfigParser.set(self, section, option, value)
  File "/usr/lib/python2.6/ConfigParser.py", line 377, in set
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'pycentral'

The solution usually lies in forcing the reinstallation of the package with the defective configuration file, but the trace is not quite helpful in determining the real source of the error.

pycentral should handle the NoSectionError and at least give a hint about the buggy package (which name is stored in self.name). As a workaround, it is possible to use

    grep -L pycentral /usr/share/pyshared-data/*

to find the configuration files without a "pycentral" section. The name of the file should then match closely to the name of the package to reinstall.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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