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

Fixed crash in ToArray when sequence explicitly denies __len__ by lostmsu · Pull Request #1484 · pythonnet/pythonnet · GitHub

Fixed crash in ToArray when sequence explicitly denies __len__ - #1484

Merged
filmor merged 1 commit into
pythonnet:masterfrom
losttech:Mini/NoCrashWhenSequenceLengthUndefined
Jul 7, 2021
Merged

Fixed crash in ToArray when sequence explicitly denies __len__#1484
filmor merged 1 commit into
pythonnet:masterfrom
losttech:Mini/NoCrashWhenSequenceLengthUndefined

Conversation

lostmsu commented Jul 7, 2021

Copy link
Copy Markdown
Member

port of 8e1d4db

What does this implement/fix? Explain your changes.

Prevents crash on converting sequences to arrays when sequence lacks __len__.

Sequence types might return error from PySequence_Size (like sequences provided by generators or types implemented in C, that lack sq_length slot or make it throw). This change adds handling for this case.

lostmsu added the mini label Jul 7, 2021
lostmsu force-pushed the Mini/NoCrashWhenSequenceLengthUndefined branch from f02f565 to 41474f1 Compare July 7, 2021 00:44
lostmsu force-pushed the Mini/NoCrashWhenSequenceLengthUndefined branch from 41474f1 to b52823b Compare July 7, 2021 00:46
filmor merged commit 2ac5f4e into pythonnet:master Jul 7, 2021
lostmsu deleted the Mini/NoCrashWhenSequenceLengthUndefined branch July 7, 2021 23:40
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.

2 participants


Back | FazBrowse Home | New Git URL