[issue4136] merge json library with latest simplejson 2.0.x

2009-05-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: Since no other patches were proposed, I applied Antoine's patch in r72194. -- status: open -> closed ___ Python tracker ___ _

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-09 Thread djc
djc added the comment: I'll take a stab at doing it Raymond's way this weekend. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-09 Thread djc
Changes by djc : -- nosy: +djc ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/op

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-08 Thread Christian Heimes
Christian Heimes added the comment: +1 for Raymond's suggestion The 3.0 version of json was more like a last minute patch work than thorough work. You might wanna svn rm the 3.0 code, svn cp the 2.7 code to the py3k branch and start all over. -- ___

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: The idea is to ignore the current 3.0 version and just redo the 2-to-3 conversion from 2.7 and do it well this time. Compute the 3.1 patch as if the current 3.0 version was blown away (reverted). -- ___ Python tr

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: > It would be better to have a patch that diff's from the current 2.7 > version than to start with the 3.0 version; otherwise, the two will > never be fully synchronized and some of the choices made in 2.6-to-3.0 > will live on forever. How am I supposed to pro

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: It would be better to have a patch that diff's from the current 2.7 version than to start with the 3.0 version; otherwise, the two will never be fully synchronized and some of the choices made in 2.6-to-3.0 will live on forever. The 2.7 version reflects more

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: (by the way, all tests pass) -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-08 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is an updated patch, completely removing the `encoding` parameter and fixing docs. -- Added file: http://bugs.python.org/file13653/json_py3k-3.patch ___ Python tracker ___

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Updated patch: - fixes all failures - removes bytes input and output "support" (which didn't work but still involved a lot of code) To be done: - remove all traces of the encoding argument, and associated machinery -- Added file: http://bugs.python.org

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Christian: 1) in py3k, loads and dumps always seem to operate on/produce str objects, but encode_basestring_ascii returns a bytes object. Why is that? 2) what is the use of the encoding argument in py3k? it looks completely ignored (bytes objects are not allowe

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: There is the problem in the current py3k version of json. b"hi" can be serialized, but not [b"hi"]. >>> json.dumps(b"hi") '"hi"' >>> json.dumps([b"hi"]) Traceback (most recent call last): File "", line 1, in File "/home/antoine/py3k/__svn__/Lib/json/__init

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here's a half-baked patch against py3k. It resolves all the conflicts but still has 15 failing tests. Perhaps someone would like to finish it up. For example, json.dumps(b"hi") works, but not json.dumps([b"hi", "hi"]) -- Added file: http://bugs.pyth

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-04 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- priority: deferred blocker -> release blocker ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue4136] merge json library with latest simplejson 2.0.x

2009-04-01 Thread Benjamin Peterson
Benjamin Peterson added the comment: This change should be ported to py3k sometime before the first beta. -- nosy: +benjamin.peterson priority: critical -> deferred blocker ___ Python tracker __

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: It might not be bad. I read through the patch a saw that it uses only the most basic C APIs and already has unicode aware sections. It may be a matter of switching the PyString functions. Will look at it in more detail later this week. Fortunately, there

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Reopening so that we don't forget to merge it in py3k :) (I have the feeling it won't be trivial, although I hope to be proven wrong) -- status: closed -> open versions: -Python 2.7 ___ Python tracker

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-17 Thread Bob Ippolito
Bob Ippolito added the comment: r70443 in trunk -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: Bob, please go ahead and commit. I don't see any advantage to letting the code continue sit in the tracker. Also, having it in will let me go forward with issue 5381 which has been held-up until this was complete. Thanks for all your work on JSON. ---

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-17 Thread Martin v. Löwis
Martin v. Löwis added the comment: The patch in its current form is fine with me, please apply (OTOH, I don't see the need for urgency - 2.7 is still many months away, and likely, we will see another update to the same code before it gets released) -- __

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-17 Thread Bob Ippolito
Bob Ippolito added the comment: All of the comments are addressed. I am not going to go through the trouble of creating a new patch to remove the remaining backwards compatibility cruft in the C code and struct function. That is easier to remove later. -- ___

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Well, if Bob has addressed all of Martin's comments, I suppose it can get in. The second step will be to port it to py3k... -- ___ Python tracker __

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: What needs to happen next for this patch to go forward? -- ___ Python tracker ___ ___ Python-bugs

[issue4136] merge json library with latest simplejson 2.0.x

2009-03-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: Martin, is this patch good-to-go? ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-28 Thread Bob Ippolito
Bob Ippolito added the comment: They are essentially the same except the relative imports are changed to use . syntax, simplejson._speedups is changed to _json, simplejson is changed to json, .format strings are used, and the test suite changes slightly. I can add fixing that struct function

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-28 Thread Martin v. Löwis
Martin v. Löwis added the comment: > simplejson maintains Python 2.4+ compatibility, but json maintains 2.6+. > I could produce another patch that manually removes these few remaining > nits if it's necessary. I don't quite understand this: isn't json/decoder.py and simplejson/decoder.py essent

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-28 Thread Martin v. Löwis
Martin v. Löwis added the comment: The one thing that IMO needs to be decided before this can be accept is the version compatibility: what Python versions must this code stay compatible with? That decision then needs to be implemented. Apart from this (and the additional minor comments below),

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Daniel Diniz
Daniel Diniz added the comment: FWIW, following simplejson's SVN history[1] makes understanding the (bits of the) patch (that I had time to look at) much easier to me. I recall other JSON packages having lots of cornercase tests, not sure if they'd be relevant here. But sprinkling a few more te

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Reviewers: , Description: Updated patch from Bob Ippolito, for updating the Python trunk json package to the latest simplejson. Please review this at http://codereview.appspot.com/20095 Affected files: Lib/json/__init__.py Lib/json/decoder.py Lib/jso

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think reformatting line length should not hold-up this patch. That is a nice-to-have, not a must-have. -- nosy: +rhettinger ___ Python tracker ___

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Bob Ippolito
Bob Ippolito added the comment: Honestly I'm not sure when I'm going to find the time and motivation to reformat the C source and tests to fit < 80 char lines. I don't think this should hold up the patch, someone who is more obsessive compulsive than myself can fix that once it hits trunk :)

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thanks for the update. I'll try to take the time for a review in less than one month. In the meantime, though, I want to point out that the 80-character rule should also apply to C files. You have quite a bit of huge C code lines, especially in parsing code. __

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-22 Thread Bob Ippolito
Bob Ippolito added the comment: New patch implementing cyclic GC, new-style relative imports, no lines >80 characters in non-test Python code Added file: http://bugs.python.org/file13152/json_issue4136_r69885.diff ___ Python tracker

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-16 Thread Bob Ippolito
Bob Ippolito added the comment: Old-style relative imports and the way that it does join are there because it's Python 2.4 compatible code that I'm porting. I'll add those to the list of things that need to be changed when backporting, implement cyclic GC on the types, and I'll take a look at

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Bob, here is a small example showing how easy it is to encounter the GC problem: from json import JSONDecoder import weakref import gc class MyObject(object): def __init__(self): self.decoder = JSONDecoder(parse_constant=self.parse_constant)

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: A bunch of comments from a quick look: - why do you use old-style relative imports ("from decoder import JSONDecoder")? - in join_list_unicode, join_list_string you could use PyUnicode_Join and _PyString_Join, respectively - in scanstring_unicode, the top comme

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-15 Thread Bob Ippolito
Changes by Bob Ippolito : Added file: http://bugs.python.org/file13106/json_issue4136_r69662.diff ___ Python tracker ___ ___ Python-bugs-list m

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-15 Thread Bob Ippolito
Bob Ippolito added the comment: patch to r69662 is attached as json_issue4136_r69662.diff -- note that simplejson 2.0.9 isn't released, as of r169 it's just simplejson 2.0.8 with some trivial changes to make this backport easier for me ___ Python tracker <

[issue4136] merge json library with latest simplejson 2.0.x

2009-02-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Bob, any news on this? -- nosy: +pitrou stage: -> needs patch title: merge json library with simplejson 2.0.3 -> merge json library with latest simplejson 2.0.x type: -> behavior versions: -Python 2.6, Python 3.0 ___