Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Bug report
Actual behavior:
>>>float('\n')Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>ValueError:couldnotconvertstringtofloat:''
Expected behavior:
>>>float('\n')Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>ValueError:couldnotconvertstringtofloat:'\n'
As long as the string isn't completely whitespace, it does display properly. For example:
>>>float('\nn')Traceback (mostrecentcalllast):File"<stdin>",line1,in<module>ValueError:couldnotconvertstringtofloat:'\nn'
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
- CPython versions tested on: 3.10.5
- Operating system and architecture: Windows 10 (64-bit)