Giter VIP home page Giter VIP logo

Comments (4)

vpelletier avatar vpelletier commented on June 28, 2024

The idea behind the change in #21 is that __transfer_py_buffer gets modified when the memory behind __transfer_buffer is modified inside the C library, to avoid copies.

But I broke this with this line in setControl, which is likely the cause of this bug:

self.__transfer_py_buffer = transfer_py_buffer[CONTROL_SETUP_SIZE:]

Could you change this line to the following and report if it fixes the problem ?

self.__transfer_py_buffer = memoryview(transfer_py_buffer)[CONTROL_SETUP_SIZE:]

The problem with this fix is that, while python3's bytearray only accepts integers for item assignment, python2's memoryview rejects integers (I'm surprised to be apparently the first to report this on python's bugtracker given the number of google hits this issue has...). So if I apply it, I force the user of my module to be actively incompatible... Gah.

from python-libusb1.

jdkeenan avatar jdkeenan commented on June 28, 2024

Awesome, this solved the problem.
Yeah, this is a pretty amazing package and has been incredible useful in my work, so keep up the great work! Also thanks for the quick response!

from python-libusb1.

vpelletier avatar vpelletier commented on June 28, 2024

Thanks for the warm words, and happy my work is useful to you !

I reopen this issue, as the bug is still present in master - just so I do not forget to push the fix once I know what to expect from python 2.7.

from python-libusb1.

vpelletier avatar vpelletier commented on June 28, 2024

Now fixed in master, and released on pypi as 1.6.4, closing.

from python-libusb1.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.