summaryrefslogtreecommitdiff
path: root/systemd/docs
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-06 22:15:46 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 14:19:17 -0400
commit0fe854e001b9f14d481f5a512dcc13f5c3531d56 (patch)
tree227a569c3e91cd9403e20ffa62b0531500ba8db4 /systemd/docs
parent68bdaeba7af98ad7af0cf757c29f8fd9baf6738b (diff)
downloadpython-systemd-0fe854e001b9f14d481f5a512dcc13f5c3531d56.tar.gz
systemd-python: catch only ValueErrors in conversion code
First of all, 'try: ... except: ...' (with no exception specified) is always a no-no, since it catches all BaseExceptions, which includes ^C and other stuff which should almost never be caught. Now the conversion is stricter, and only one conversion is attempted, and only a ValueEror is caught. It seems reasonable to catch ValueErrors, since the entries in the journal are not verified, and any erroneous application might log a field which cannot be converted. The consumer of events must only check if a field is an instance of bytes and can otherwise assume that the conversion was performed correctly. Order of arguments in Reader.__init__ has been changed to match order in _Reader.__init__. Conversions have been updated to work under Python 2 and 3.
Diffstat (limited to 'systemd/docs')
0 files changed, 0 insertions, 0 deletions