Skip to content

BUG: Fix subarray dtype used with too large count in fromfile#17832

Merged
charris merged 1 commit intonumpy:masterfrom
seberg:fix-read-less-than-requested
Nov 23, 2020
Merged

BUG: Fix subarray dtype used with too large count in fromfile#17832
charris merged 1 commit intonumpy:masterfrom
seberg:fix-read-less-than-requested

Conversation

@seberg
Copy link
Copy Markdown
Member

@seberg seberg commented Nov 23, 2020

This also affects fromtext, although only in the deprecated path.

Closes gh-17819


Turns out stealing references tends to come back to bite you :)... @charris, you will be happy to know that while the test is reliable, it doesn't actually crash reliably on my compter, so there is probably a lot of randomness involved...

I think we can backport this to 1.19.x and should, but I have not checked.

This also affects fromtext, although only in the deprecated path.

Closes numpygh-17819
@seberg seberg added 08 - Backport Used to tag backport PRs 00 - Bug labels Nov 23, 2020
@charris charris added 09 - Backport-Candidate PRs tagged should be backported and removed 08 - Backport Used to tag backport PRs labels Nov 23, 2020
@charris charris added this to the 1.19.5 release milestone Nov 23, 2020
@charris
Copy link
Copy Markdown
Member

charris commented Nov 23, 2020

Why not stealing the dtype?

@seberg
Copy link
Copy Markdown
Member Author

seberg commented Nov 23, 2020

Well, have to hold on to it for the resize (at least that seems like the easiest way). And one of the functions already holds on to it internally anyway, so overall it seemed easier to just not steal at all...

And in the end, stealing references tends to just add a bit complexity to understanding code (but that may just be my opinion, I used to even like it sometimes for convenience).

@charris
Copy link
Copy Markdown
Member

charris commented Nov 23, 2020

stealing references tends to just add a bit complexity to understanding code

That it does, especially when the documentation is spotty. I wish Python did less of it.

@charris charris merged commit c062845 into numpy:master Nov 23, 2020
@charris
Copy link
Copy Markdown
Member

charris commented Nov 23, 2020

Lets give it a shot. Thanks Sebastian.

@seberg
Copy link
Copy Markdown
Member Author

seberg commented Nov 23, 2020

Thanks, sorry there are so many last minute things to wrap up for 1.20... I guess it comes with the it being such a big release.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Dec 4, 2020
@charris charris removed this from the 1.19.5 release milestone Dec 4, 2020
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.

Python crash on access to the result of numpy.fromfile

2 participants