system-config-kickstart: Traceback on opening a nonexistent file

Bug #409554 reported by Brent Fox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
system-config-kickstart (Ubuntu)
Fix Released
Undecided
Colin Watson

Bug Description

Binary package hint: system-config-kickstart

Description: Ubuntu karmic (development branch)
Release: 9.10

system-config-kickstart:
  Installed: 2.5.20-0ubuntu19
  Candidate: 2.5.20-0ubuntu19
  Version table:
 *** 2.5.20-0ubuntu19 0
        500 http://us.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

Description: When trying to run system-config-kickstart from the command line with a bogus filename for a kickstart file, you get the following traceback:

Traceback (most recent call last):
  File "./system-config-kickstart.py", line 82, in <module>
    kickstartGui.kickstartGui(file)
  File "/home/bfox/packages/system-config-kickstart/karmic-orig/system-config-kickstart-2.5.20/src/kickstartGui.py", line 168, in __init__
    self.kickstartParser = kickstartParser.KickstartParser(self.kickstartData, file)
  File "/home/bfox/packages/system-config-kickstart/karmic-orig/system-config-kickstart-2.5.20/src/kickstartParser.py", line 71, in __init__
    self.readKickstartFile(file)
  File "/home/bfox/packages/system-config-kickstart/karmic-orig/system-config-kickstart-2.5.20/src/kickstartParser.py", line 74, in readKickstartFile
    self.lines = open(file, "r").readlines()
IOError: [Errno 2] No such file or directory: 'foo.cfg'

I am attaching a patch which should handle this situation more gracefully.

Revision history for this message
Brent Fox (brent-s-fox) wrote :
Revision history for this message
Colin Watson (cjwatson) wrote :

I tweaked this a bit to improve the message (the file name won't reliably be at the end of the sentence in all languages, and it would be good to print the error message too). Thanks.

Changed in system-config-kickstart (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package system-config-kickstart - 2.5.20-0ubuntu20

---------------
system-config-kickstart (2.5.20-0ubuntu20) karmic; urgency=low

  [ Brent Fox ]
  * Fix GtkSpinButton warnings (LP: #409261).
  * Hook up event handlers after calling self.toplevel.show() (LP: #409270).
  * Print usage message on getopt errors (LP: #409352).
  * Add ext4 to supported filesystem types (LP: #409368).
  * Print a proper error if file opens fail (LP: #409554).

 -- Colin Watson <email address hidden> Tue, 11 Aug 2009 14:19:34 +0100

Changed in system-config-kickstart (Ubuntu):
status: Fix Committed → Fix Released
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.