This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
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) * (Python triager) | 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) * (Python committer) | Date: 2016年09月01日 16:26 | |
Setting this aside for Nofar to review. |
|||
| msg275425 - (view) | Author: Nofar Schnider (Nofar Schnider) * (Python triager) | Date: 2016年09月09日 20:29 | |
Tested and reviewed the patch on the relevant versions. Works well! |
|||
| msg275428 - (view) | Author: Nofar Schnider (Nofar Schnider) * (Python triager) | 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) * (Python committer) | 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) * (Python committer) | 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 stage: patch review -> resolved |
| 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 nosy: + rhettinger |
| 2016年06月16日 06:17:21 | Pedro Lacerda | set | files:
+ float.patch nosy: + Pedro Lacerda messages: + msg268644 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 versions: + Python 2.7, Python 3.6 |
| 2016年06月08日 14:34:24 | Drekin | create | |