Re: [PATCH 08/34] lsusb.py: do not entirely hide usb.ids exceptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 06, 2019 at 12:02:15PM +0300, Mantas Mikulėnas wrote:
> Signed-off-by: Mantas Mikulėnas <grawity@xxxxxxxxx>
> ---
>  lsusb.py.in | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/lsusb.py.in b/lsusb.py.in
> index f9e273d..0d7ff95 100644
> --- a/lsusb.py.in
> +++ b/lsusb.py.in
> @@ -610,9 +610,8 @@ def main(argv):
>  	if usbids[0]:
>  		try:
>  			parse_usb_ids()
> -		except:
> -			print(" WARNING: Failure to read usb.ids", file=sys.stderr)
> -			#print(sys.exc_info(), file=sys.stderr)
> +		except IOError as e:
> +			print("Warning: Failure to read usb.ids:", e, file=sys.stderr)

This patch is a bit "annoying" in that now I see the error:
	Warning: Failure to read usb.ids: [Errno 2] No such file or directory: '/usr/share/kcmusb/usb.ids'

When I never would care about /usr/share/kcmusb, the "problem" is that
the usb.ids file is no where in any of the other "default" choices in
the system.

So I suggest either saying "here's all the places I did not find it", or
just stick to the error that we have today, as this feels worse to me.

thanks,

greg k-h



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux