Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 661606 - sys-apps/usbutils-010: Python 3.7 support
Summary: sys-apps/usbutils-010: Python 3.7 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-19 19:15 UTC by Craig Andrews
Modified: 2018-07-20 22:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Andrews gentoo-dev 2018-07-19 19:15:45 UTC
Please add Python 3.7 support.

I added it the ebuild, ran the tests, and everything passed.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2018-07-20 10:53:10 UTC
Well, usbutils only installs a single Python script. However, have you actually tried to run it?

> WARNING: Failure to read usb.ids
> Traceback (most recent call last):
>   File "/var/tmp/portage/sys-apps/usbutils-010/image/usr/bin/lsusb.py", line 587, in main
>     parse_usb_ids()
>   File "/var/tmp/portage/sys-apps/usbutils-010/image/usr/bin/lsusb.py", line 110, in parse_usb_ids
>     for ln in file(usbids, "r").readlines():
> NameError: name 'file' is not defined

Happens with py2.7-py3.7.

OK, this one is probably easy to fix. When I change

> -         for ln in file(usbids, "r").readlines():
> +         for ln in open(usbids, "r").readlines():

But then I'll get

> usb1             1d6b:0002 09  2.00  480MBit/s 0mA 1IF  (ehci_hcd 0000:02:03.0) hub
> usb2             1d6b:0001 09  1.10   12MBit/s 0mA 1IF  (uhci_hcd 0000:02:00.0) hub
>  2-1             0e0f:0003 00  1.10   12MBit/s 0mA 1IF  (VMware VMware Virtual USB Mouse)
>  2-2             0e0f:0002 09  1.10   12MBit/s 0mA 1IF  (VMware, Inc. Virtual USB Hub) hub
> 

with py2.7 but

> Traceback (most recent call last):
>   File "/var/tmp/portage/sys-apps/usbutils-010/image/usr/bin/lsusb.py", line 587, in main
>     parse_usb_ids()
>   File "/var/tmp/portage/sys-apps/usbutils-010/image/usr/bin/lsusb.py", line 110, in parse_usb_ids
>     for ln in open(usbids, "r").readlines():
>   File "/usr/lib/python3.7/codecs.py", line 322, in decode
>     (result, consumed) = self._buffer_decode(data, self.errors, final)
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 349: invalid start byte

In other words: This package doesn't work with >py2.7.
Comment 2 Larry the Git Cow gentoo-dev 2018-07-20 12:38:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cbbd2e07732410bd9e402690d2093e20091a0a5

commit 0cbbd2e07732410bd9e402690d2093e20091a0a5
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-07-20 12:37:54 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-07-20 12:38:20 +0000

    sys-apps/usbutils: Remove Py3.x support
    
    Python script installed by that package doesn't work using
    Py3.x.
    
    Closes: https://bugs.gentoo.org/661606
    Package-Manager: Portage-2.3.43, Repoman-2.3.10

 sys-apps/usbutils/usbutils-010.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Larry the Git Cow gentoo-dev 2018-07-20 13:09:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b1b17fd5d137a375cc181fa9994ee63e5804d66

commit 2b1b17fd5d137a375cc181fa9994ee63e5804d66
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2018-07-20 13:08:56 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2018-07-20 13:09:11 +0000

    sys-apps/usbutils: Rev bump to add and fix Py3 support
    
    Closes: https://bugs.gentoo.org/661606
    Package-Manager: Portage-2.3.43, Repoman-2.3.10

 .../files/usbutils-010-fix-py3-support.patch       | 145 +++++++++++++++++++++
 ...{usbutils-010.ebuild => usbutils-010-r1.ebuild} |   4 +-
 2 files changed, 148 insertions(+), 1 deletion(-)