Permalink
Browse files

Bump to 1.6.2 .

Fix getASCIIStringDescriptor.
1 parent 61524bc commit c26528283d50760ef870e86fc9a4d33e575bb597 @vpelletier committed Jan 3, 2017
Showing with 8 additions and 7 deletions.
  1. +6 −0 README.rst
  2. +1 −1 setup.py
  3. +1 −6 usb1/__init__.py
View
@@ -376,6 +376,12 @@ Fix and extend get{,ASCII}StringDescriptor .
Fix iterISO and getISOBufferList.
+1.6.2
+-----
+
+Fix getASCIIStringDescriptor: unlike getStringDescriptor, this returns only the
+payload of the string descriptor, without its header.
+
.. _CPython: http://www.python.org/
.. _pypy: http://pypy.org/
View
@@ -33,7 +33,7 @@
description=next(x for x in long_description.splitlines() if x.strip()),
long_description='.. contents::\n\n' + long_description,
keywords='usb libusb',
- version='1.6.1',
+ version='1.6.2',
author='Vincent Pelletier',
author_email='plr.vincent@gmail.com',
url='http://github.com/vpelletier/python-libusb1',
View
@@ -1346,12 +1346,7 @@ def getASCIIStringDescriptor(self, descriptor, errors='strict'):
except USBErrorNotFound:
# pylint: enable=undefined-variable
return None
- if received < 2 or descriptor_string[1] != DT_STRING:
- raise ValueError('Invalid string descriptor')
- return descriptor_string[2:min(
- received,
- descriptor_string[0],
- )].decode('ASCII', errors=errors)
+ return descriptor_string[:received].decode('ASCII', errors=errors)
# Sync I/O

0 comments on commit c265282

Please sign in to comment.