Results 1 to 7 of 7

Thread: Many python-based programs fail to start

  1. #1
    Join Date
    Feb 2008
    Beans
    189

    Many python-based programs fail to start

    Many programs based on python (example here is the burn command-line disk burning program) crash on startup with errors similar to this one:

    Code:
     File "<string>", line 1, in <module>
      File "/usr/lib/pymodules/python2.7/burnlib/burn.py", line 654, in main
        prog_intro()
      File "/usr/lib/pymodules/python2.7/burnlib/burn.py", line 156, in prog_intro
        if config.getboolean('general', 'ask_root'):
      File "/usr/lib/python2.7/ConfigParser.py", line 360, in getboolean
        v = self.get(section, option)
      File "/usr/lib/python2.7/ConfigParser.py", line 599, in get
        raise NoSectionError(section)
    ConfigParser.NoSectionError: No section: 'general'
    It appears to be searching for some missing Python libraries or something.
    Looking for a Terminal Emulator that's fun to use? Try out this program I wrote!

  2. #2
    Join Date
    Feb 2008
    Beans
    189

    Re: Many python-based programs fail to start

    anyone know how to fix this?
    Looking for a Terminal Emulator that's fun to use? Try out this program I wrote!

  3. #3
    Join Date
    Sep 2010
    Location
    NE Oklahoma
    Beans
    36
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Many python-based programs fail to start

    Have you reported it to the devs? Many times, it's a pretty quick fix for them.

  4. #4
    Join Date
    Aug 2008
    Beans
    10

    Re: Many python-based programs fail to start

    Doesn't look like a Python specific problem to me - looks like data missing from a configuration file, or the whole file being missing.

  5. #5
    Join Date
    Feb 2010
    Location
    Silicon Valley
    Beans
    1,898
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Many python-based programs fail to start

    It's a program bug.

    See /usr/share/pyshared/burnlib/burn.py. If you run burn with no arguments, then on line 654, the prog_intro() function is called, which relies on configuration information. However, that config info is not loaded until line 658.

    Apply this patch to remove the call to prog_intro():
    Code:
      $ diff -u `pwd`/burn.py.00 `pwd`/burn.py
    --- /usr/share/pyshared/burnlib/burn.py.00      2009-12-22 03:58:01.000000000 -0800
    +++ /usr/share/pyshared/burnlib/burn.py 2011-06-22 09:06:35.708510617 -0700
    @@ -651,7 +651,7 @@
         if len(sys.argv) > 1:
             check_main_option(sys.argv[1])
         else:
    -        prog_intro()
    +        #prog_intro()
             parser.print_help()
             sys.exit()
    Last edited by gmargo; June 22nd, 2011 at 05:07 PM.

  6. #6
    Join Date
    Feb 2008
    Beans
    189

    Re: Many python-based programs fail to start

    Quote Originally Posted by gmargo View Post
    Apply this patch to remove the call to prog_intro():
    Code:
      $ diff -u `pwd`/burn.py.00 `pwd`/burn.py
    --- /usr/share/pyshared/burnlib/burn.py.00      2009-12-22 03:58:01.000000000 -0800
    +++ /usr/share/pyshared/burnlib/burn.py 2011-06-22 09:06:35.708510617 -0700
    @@ -651,7 +651,7 @@
         if len(sys.argv) > 1:
             check_main_option(sys.argv[1])
         else:
    -        prog_intro()
    +        #prog_intro()
             parser.print_help()
             sys.exit()
    how do I apply that patch?

    Copying it into the terminal (as a whole or line-by-line) doesn't work.
    Looking for a Terminal Emulator that's fun to use? Try out this program I wrote!

  7. #7
    Join Date
    Feb 2010
    Location
    Silicon Valley
    Beans
    1,898
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Many python-based programs fail to start

    Well, I shouldn't have used the patch (aka "diff") format for that simple a difference.
    I originally had a more complicated patch, but afterwards found this simpler one.

    If you supply appropriate arguments to the burn command, then you do not
    need to edit anything. This patch just covers the one oddball case that the original
    authors missed.

    To apply the patch "by hand", just edit the file /usr/share/pyshared/burnlib/burn.py and comment out that one line (approx line 654).

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •