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 6, 2019 at 3:29 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 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

Ah, I guess I'll have to redo that. Maybe it would be best to suppress
errors for default paths, but still show them for user-specified paths
(--usbids-path)?

(Actually, I assumed @usbids@ as the 1st item would be substituted on
most systems. However, I don't quite understand why e.g. the KDE
kcmusb path was added here... Is the list meant to have all possible
paths, or is it meant to require the distro to specify the path? It's
currently a mix of both.)

-- 
Mantas Mikulėnas




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

  Powered by Linux