New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The ValueError for converting an all-whitespace string to a float misleadingly displays it as the empty string #95605
Comments
|
Thanks for the report. This is caused by an unfortunate interaction between Specifically, after the #95665 should fix this. |
…ace (GH-95665) This PR fixes the error message from float(s) in the case where s contains only whitespace.
…hitespace (pythonGH-95665) This PR fixes the error message from float(s) in the case where s contains only whitespace. (cherry picked from commit 97e9cfa) Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
…hitespace (pythonGH-95665) This PR fixes the error message from float(s) in the case where s contains only whitespace. (cherry picked from commit 97e9cfa) Co-authored-by: Mark Dickinson <dickinsm@gmail.com>


Zeturic commentedAug 3, 2022
Bug report
Actual behavior:
Expected behavior:
As long as the string isn't completely whitespace, it does display properly. For example:
In addition to newlines, the same thing can be observed with tabs and carriage returns, or any combination of the three. I didn't test any additional whitespace characters, though they would likely behave the same way.
Your environment
The text was updated successfully, but these errors were encountered: