Skip to content

Conversation

@Alvaro-Kothe
Copy link
Member

@Alvaro-Kothe Alvaro-Kothe commented Oct 18, 2025


This patch uses strtol to compute the exponent and checks overflow by the errno assigned on strtol and with checked_add.

I deleted the previous tests regarding large exponents because they were validating the undefined behavior caused by the overflow, where in one test asserts that 10E-99999999999999999 is parsed as 0.0, while on the other 10E-999999999999999999 (contains 1 digit more) is parsed as a string.

Now, the float parsing on overflow follows the results from pyarrow.

@Alvaro-Kothe Alvaro-Kothe marked this pull request as ready for review October 19, 2025 00:11
@Alvaro-Kothe Alvaro-Kothe marked this pull request as draft October 20, 2025 18:37
@Alvaro-Kothe Alvaro-Kothe marked this pull request as ready for review October 20, 2025 21:00
@mroeschke mroeschke requested a review from WillAyd October 21, 2025 17:13
@mroeschke mroeschke added the IO CSV read_csv, to_csv label Oct 21, 2025
@WillAyd WillAyd merged commit c8fcf7e into pandas-dev:main Oct 21, 2025
47 checks passed
@WillAyd
Copy link
Member

WillAyd commented Oct 21, 2025

Great thanks @Alvaro-Kothe

@Alvaro-Kothe Alvaro-Kothe deleted the fix/double-segfault branch October 21, 2025 23:58
mittal-aakriti pushed a commit to mittal-aakriti/pandas that referenced this pull request Nov 19, 2025
mittal-aakriti pushed a commit to mittal-aakriti/pandas that referenced this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IO CSV read_csv, to_csv

Projects

None yet

3 participants