Skip to content

When data_or_wLength is an array, keep the same object (alt fix)#529

Closed
kauwua wants to merge 1 commit intopyusb:masterfrom
kauwua:fix_ctrl_transfer_regression_alt
Closed

When data_or_wLength is an array, keep the same object (alt fix)#529
kauwua wants to merge 1 commit intopyusb:masterfrom
kauwua:fix_ctrl_transfer_regression_alt

Conversation

@kauwua
Copy link
Copy Markdown

@kauwua kauwua commented Jan 7, 2025

Alt fix proposed in #527.

In v1.2.1, when data_or_wLength was an array, a TypeError exception was triggered in create_buffer which means _interop.as_array was called and the same array object was used (modified in-place as expected).

In v1.3.0, commit 3ea79b0 introduced a change in create_buffer that does not trigger the TypeError exception and instead creates a new array from the one passed in data_or_wLength.

This means a new array is created and receives data for IN transfers, not the array passed as argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants