[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2022-03-18 Thread Daniël van Noord
Daniël van Noord added the comment: @Bayard Randel, do you want to make this patch into a GitHub PR? If not, I could help by doing so and try to get this landed. -- nosy: +danielnoord ___ Python tracker

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2016-10-04 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2016-09-13 Thread R. David Murray
Changes by R. David Murray : -- versions: +Python 3.5, Python 3.6, Python 3.7 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2016-09-13 Thread R. David Murray
R. David Murray added the comment: Robert: as noted, skipping trailing whitespace would be breaking raw_decode's contract. It is designed to parse a json document and return the position of the last character of that document. If there is then another json document in the stream, parsing

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2016-09-13 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- nosy: -petri.lehtinen ___ Python tracker ___ ___

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2016-09-12 Thread Robert Collins
Robert Collins added the comment: I think the patch should either be rejected, or also handle trailing spaces: if we're taking the RFC definition of whitespace not being structural then we should also eat trailing space, which will change the check for extra data in decode to just checking

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2016-09-12 Thread Bayard Randel
Bayard Randel added the comment: I've provided an updated patch for 3.6. Additionally I've updated the docstring for decoder.raw_decode to explain that whitespace at the beginning of the document will be ignored. I believe the concerns around the backwards incompatible change to the function

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-08-23 Thread Petri Lehtinen
Petri Lehtinen added the comment: I think skipping preceding whitespace in raw_decode() wouldn't hurt, but skipping following whitespace would be wrong. David: Any examples of how this could break backwards compatibility? -- nosy: +petri.lehtinen

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-08-23 Thread R. David Murray
R. David Murray added the comment: I didn't have anything specific in mind, just making a general comment about the care that needs to be taken in crafting the fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15393

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-20 Thread Antti Laine
Antti Laine antti.a.la...@iki.fi added the comment: you are changing the signature of decode() and that would be a compatibility problem I was changing the signature of raw_decode(), by adding a(n almost) private keyword. I really don't see how that would affect compatibility. you are

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Antti Laine
New submission from Antti Laine antti.a.la...@iki.fi: raw_decode on json.JSONDecoder does not handle leading whitespace. According to RFC 4627, section 2, whitespace can precede an object. With json.loads leading whitespace is handled just fine. d = json.JSONDecoder() d.raw_decode(' {}')

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Antti Laine
Antti Laine antti.a.la...@iki.fi added the comment: My coworker just submitted a pull request for a possible fix to simplejson on github. https://github.com/simplejson/simplejson/pull/38 -- ___ Python tracker rep...@bugs.python.org

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti versions: +Python 3.3, Python 3.4 -Python 2.6, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15393 ___

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Please, post a patch for 2.7 and 3.2/3.3, with a test. Seems quite easy. If you hurry, this could go in 3.3.0. -- keywords: +easy nosy: +jcea stage: - needs patch ___ Python tracker

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Antti Laine
Antti Laine antti.a.la...@iki.fi added the comment: Suggestion for a patch for 3.3.0. I wasn't quite sure how the testcases were supposed to be loaded. Sorry if I made a mess ;) -- keywords: +patch Added file: http://bugs.python.org/file26434/json-raw-decoder-fix-whitespace.diff

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Antti, you are changing the signature of decode() and that would be a compatibility problem. Can you rewrite the patch to be more compatible? In your test, please, use a bit more complicated object than {} :-) --

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: IMO this is not a bug, according to the current documentation it is working as designed. raw_decode says it decodes a string that *starts with* a json document. To my understanding, raw_decode is designed to be used when parsing a

[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-19 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Ah, I see, you are thinking that json document includes the possibility of leading whitespace. That is a reasonable interpretation...just make sure that we don't break backward compatibility. --