Issue27268
Created on 2016-06-08 14:34 by Drekin, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| float.patch | Pedro Lacerda, 2016-06-16 06:17 | |||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 2745 | merged | Pedro Lacerda, 2017-07-18 01:12 | |
| PR 3722 | closed | Cryvate, 2017-09-24 17:18 | |
| Messages (10) | |||
|---|---|---|---|
| msg267858 - (view) | Author: Adam Bartoš (Drekin) * | Date: 2016-06-08 14:34 | |
>>> float('foo')
ValueError: could not convert string to float: 'foo'
>>> float('')
ValueError: could not convert string to float:
should be
ValueError: could not convert string to float: ''
The message comes from Objects/floatobject.c:183 but I don't understand how the empty string gets discarded.
|
|||
| msg267864 - (view) | Author: Eryk Sun (eryksun) * ![]() |
Date: 2016-06-08 15:26 | |
> The message comes from Objects/floatobject.c:183 No, in this case the error is set in PyOS_string_to_double in Python/pystrtod.c, because `fail_pos == s`, and it doesn't get replaced in PyFloat_FromString because `end == last`. The format string in PyOS_string_to_double should probably be "'%.200s'". |
|||
| msg268644 - (view) | Author: Pedro Lacerda (Pedro Lacerda) * | Date: 2016-06-16 06:17 | |
Following the bug pointed by Adam and Eryk. |
|||
| msg274150 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2016-09-01 16:26 | |
Setting this aside for Nofar to review. |
|||
| msg275425 - (view) | Author: Nofar Schnider (Nofar Schnider) * ![]() |
Date: 2016-09-09 20:29 | |
Tested and reviewed the patch on the relevant versions. Works well! |
|||
| msg275428 - (view) | Author: Nofar Schnider (Nofar Schnider) * ![]() |
Date: 2016-09-09 20:35 | |
Assigning to Raymond for final approval. |
|||
| msg297812 - (view) | Author: Wolfgang Maier (wolma) * | Date: 2017-07-06 07:45 | |
Could somebody turn this into a PR to move things forward? I guess Nofar mistakenly set resolution to "works for me", but meant "patch works for me"? |
|||
| msg302871 - (view) | Author: Henk-Jaap Wagenaar (cryvate) * | Date: 2017-09-24 17:20 | |
@Wolfgang I just created a PR, only to realise that Pedro already made one a while back: PR 2745 |
|||
| msg342771 - (view) | Author: Cheryl Sabella (cheryl.sabella) * ![]() |
Date: 2019-05-17 22:32 | |
New changeset 4fa7504ee3184cff064e23fe6799e717ed0f9357 by Cheryl Sabella (Pedro Lacerda) in branch 'master': bpo-27268: Fix incorrect error message on float('') (GH-2745) https://github.com/python/cpython/commit/4fa7504ee3184cff064e23fe6799e717ed0f9357 |
|||
| msg342772 - (view) | Author: Cheryl Sabella (cheryl.sabella) * ![]() |
Date: 2019-05-17 22:35 | |
@Drekin, thank you for the report, @Pedro Lacerda, thank you for the pull request, and @Nofar Schnider, thank you for the review. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:32 | admin | set | github: 71455 |
| 2019-05-17 22:35:40 | cheryl.sabella | set | status: open -> closed nosy: rhettinger, mark.dickinson, eryksun, Drekin, wolma, Nofar Schnider, Pedro Lacerda, cheryl.sabella, cryvate messages: + msg342772 resolution: works for me -> fixed |
| 2019-05-17 22:32:50 | cheryl.sabella | set | nosy:
+ cheryl.sabella messages: + msg342771 |
| 2017-09-24 17:20:05 | cryvate | set | nosy:
+ cryvate messages: + msg302871 |
| 2017-09-24 17:18:33 | Cryvate | set | pull_requests: + pull_request3708 |
| 2017-09-24 16:50:17 | rhettinger | set | assignee: rhettinger -> versions: - Python 2.7, Python 3.5, Python 3.6 |
| 2017-07-18 01:12:00 | Pedro Lacerda | set | pull_requests: + pull_request2805 |
| 2017-07-06 07:45:10 | wolma | set | nosy:
+ wolma messages: + msg297812 |
| 2016-10-25 12:42:34 | serhiy.storchaka | set | nosy:
- serhiy.storchaka versions: + Python 3.7 |
| 2016-09-10 00:14:27 | lukasz.langa | set | dependencies: + Strings passed to KeyError do not round trip |
| 2016-09-09 20:35:45 | Nofar Schnider | set | assignee: Nofar Schnider -> rhettinger resolution: works for me messages: + msg275428 |
| 2016-09-09 20:29:26 | Nofar Schnider | set | messages:
+ msg275425 stage: patch review |
| 2016-09-06 22:58:11 | rhettinger | set | assignee: rhettinger -> Nofar Schnider nosy: + Nofar Schnider |
| 2016-09-01 16:26:19 | rhettinger | set | assignee: rhettinger messages:
+ msg274150 |
| 2016-06-16 06:17:21 | Pedro Lacerda | set | files:
+ float.patch nosy:
+ Pedro Lacerda keywords: + patch |
| 2016-06-08 17:41:45 | serhiy.storchaka | set | nosy:
+ mark.dickinson, serhiy.storchaka |
| 2016-06-08 15:26:24 | eryksun | set | nosy:
+ eryksun messages:
+ msg267864 |
| 2016-06-08 14:34:24 | Drekin | create | |

