FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix `GetBuffer` throwing `ArgumentOutOfRangeException` by legomanww · Pull Request #2120 · pythonnet/pythonnet · GitHub

Fix GetBuffer throwing ArgumentOutOfRangeException - #2120

Merged
lostmsu merged 3 commits into
pythonnet:masterfrom
legomanww:fix/bufferlen
Mar 12, 2023
Merged

Fix GetBuffer throwing ArgumentOutOfRangeException#2120
lostmsu merged 3 commits into
pythonnet:masterfrom
legomanww:fix/bufferlen

Conversation

Copy link
Copy Markdown
Contributor

What does this implement/fix? Explain your changes.

PyBuffer throws System.ArgumentOutOfRangeException when trying to use GetBuffer() with anything other than PyBUF.SIMPLE since the Marshal.Copy calls had a typos so it was trying to copy shape, strides, and suboffsets as arrays that were the full length of the source array instead of length ndim.

Does this close any currently open issues?

no

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Ensure you have signed the .NET Foundation CLA <- doesn't seem to be working
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

lostmsu commented Mar 12, 2023

Copy link
Copy Markdown
Member

NIT: add parameter names to Copy calls (e.g. length: ...). Would be easier to spot the mistake next time.

lostmsu merged commit 131b466 into pythonnet:master Mar 12, 2023
legomanww deleted the fix/bufferlen branch March 13, 2023 00:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL