After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 540898 - Doesn't handle missing lircd.conf file
Doesn't handle missing lircd.conf file
Status: RESOLVED FIXED
Product: gnome-lirc-properties
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Mathias Hasselmann (IRC: tbf)
Mathias Hasselmann (IRC: tbf)
Depends on:
Blocks: 530359
 
 
Reported: 2008-06-30 10:48 UTC by Bastien Nocera
Modified: 2008-06-30 16:43 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2008-06-30 10:48:01 UTC
On a default installation, lircd.conf is a ghost file (meaning it is owned by the lirc RPM but not present on the filesystem):

Traceback (most recent call last):
  • File "/usr/bin/gnome-lirc-properties", line 27 in <module>
    gnome_lirc_properties.run(sys.argv[1:], datadir)
  • File "/usr/lib/python2.5/site-packages/gnome_lirc_properties/__init__.py", line 57 in run
    return ui.RemoteControlProperties(gtk.glade.XML(ui_filename)).run()
  • File "/usr/lib/python2.5/site-packages/gnome_lirc_properties/ui/RemoteControlProperties.py", line 60 in __init__
    self.__restore_hardware_settings()
  • File "/usr/lib/python2.5/site-packages/gnome_lirc_properties/ui/RemoteControlProperties.py", line 261 in __restore_hardware_settings
    if (not lirc.check_hardware_settings(remote) and
  • File "/usr/lib/python2.5/site-packages/gnome_lirc_properties/lirc.py", line 1047 in check_hardware_settings
    open(config.LIRC_DAEMON_CONF).read(), re.MULTILINE):
IOError: [Errno 2] No such file or directory: '/etc/lircd.conf'

The current code reads:
    if not re.search(•
        r'^\s*include\s+%s\s*$' % re.escape(config.LIRC_REMOTE_CONF),•
        open(config.LIRC_DAEMON_CONF).read(), re.MULTILINE):•
        return False•
Comment 1 Bastien Nocera 2008-06-30 10:58:57 UTC
Adding this line before the re.search should do it:
    if not os.path.exists(remote_config):
       return True•
Comment 2 Murray Cumming 2008-06-30 11:35:27 UTC
That seems OK because I guess that a missing lircd.conf is acceptable so it's OK for that check_hardware_settings() function to say that it is indeed sane. Please commit.
Comment 3 Bastien Nocera 2008-06-30 16:43:13 UTC
2008-06-30  Bastien Nocera  <hadess@hadess.net>

	* gnome_lirc_properties/lirc.py: Handle the lircd.conf
	file being missing (it's not broken if it's not there!)
	(Closes: #540898)