[issue19871] json module won't parse a float that starts with a decimal point

2017-03-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___

[issue19871] json module won't parse a float that starts with a decimal point

2014-03-28 Thread Steve Holden
Steve Holden added the comment: How about: A simple JSON decoder that converts between JSON string representations and Python data structures? -- nosy: +holdenweb ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871

[issue19871] json module won't parse a float that starts with a decimal point

2014-03-24 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list

[issue19871] json module won't parse a float that starts with a decimal point

2014-01-19 Thread Vajrasky Kok
Vajrasky Kok added the comment: Attached the patch to address Ezio Melotti's concern. Thanks for the review! -- Added file: http://bugs.python.org/file33558/parse_non_valid_json_float_with_unit_test_v2.patch ___ Python tracker rep...@bugs.python.org

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: How about this doc fix? -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file33159/fix_doc_parse_non_valid_json_float.patch ___ Python tracker rep...@bugs.python.org

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-16 Thread Vajrasky Kok
Vajrasky Kok added the comment: Okay, I added unit test for this edge case. -- Added file: http://bugs.python.org/file33160/parse_non_valid_json_float_with_unit_test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Mark Dickinson
Mark Dickinson added the comment: Oddly, with all of the strictness in JSON, the exponent-marker e can be upper- or lower-case I'd guess that the aim is that common floating-point output formats from a variety of languages are valid JSON. That would also explain why both '+' and '-' are

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Tim Peters
Tim Peters added the comment: We should adhere to the json spec, but there's no harm (and some real good!) in the docs pointing out notable cases where json and Python syntax differ. -- nosy: +tim.peters ___ Python tracker rep...@bugs.python.org

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are too many cases where json and Python syntax differ. Final comma([1, 2,]), non-string keys ({1: 2}), tuples ((1, 2)), leading zeros (0001), hexadecimal integers (0xaf), escapes of astral characters('\U0001d504'), single quotes ('spam'), octal

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread picomancer
New submission from picomancer: Try the following in your favorite Python version: import json json.loads(.5) On my Python (2.7.4 and 3.3.1 on Ubuntu Saucy Salamander), I get an exception. However, x = .5 is a valid Python number. With respect to the parsing of floats by the json

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think it would be better to adhere to the JSON spec, which doesn't allow numbers to start with a decimal point: http://json.org/ If we go this way, the documentation should at least be fixed; and, as you say, we could also add a unit test for it.

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Agree with Antoine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread Mark Dickinson
Mark Dickinson added the comment: In context, the doc is correct: parse_float, if specified, will be called with the string of every JSON float to be decoded. By default, this is equivalent to float(num_str). IIUC, parse_float only comes into play once the JSON source has already been

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread Ned Batchelder
Ned Batchelder added the comment: There are other forms of numbers allowed by Python that are not allowed by JSON: 001.1 Oddly, with all of the strictness in JSON, the exponent-marker e can be upper- or lower-case: 1e1 and 1E1 are both valid JSON. -- nosy: +nedbat

[issue19871] json module won't parse a float that starts with a decimal point

2013-12-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list