Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

2.5.1 can't dump json due to Decimal option (tested on os x) #35

Closed
NorthIsUp opened this Issue May 10, 2012 · 3 comments

2 participants

Adam Bob Ippolito
Adam

Here are the commands I ran

╭─○─[Wowbagger.local@Darwin]─[~]─[DON'T PANIC]-[ret:0]─[hist:4268]
╰─[:)]─> ⚡ mkvirtualenv json_test                                                                                                                  ▶▶▶▶▶▶▶▶▶▷
New python executable in json_test/bin/python
Please make sure you remove any previous custom paths from your /Users/adam/.pydistutils.cfg file.
Installing setuptools.............done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating /Users/adam/.virtualenvs/json_test/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/adam/.virtualenvs/json_test/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/adam/.virtualenvs/json_test/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/adam/.virtualenvs/json_test/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/adam/.virtualenvs/json_test/bin/get_env_details
git: Permission denied

╭─(json_test)─○─[Wowbagger.local@Darwin]─[~]─[DON'T PANIC]-[ret:0]─[hist:4269]
╰─[:)]─> ⚡ pip install simplejson                                                                                                                  ▶▶▶▶▶▶▶▶▶▷
Downloading/unpacking simplejson
  Downloading simplejson-2.5.1.tar.gz (52Kb): 52Kb downloaded
  Running setup.py egg_info for package simplejson

Installing collected packages: simplejson
  Running setup.py install for simplejson
    building 'simplejson._speedups' extension
    /usr/bin/llvm-gcc -fno-strict-aliasing -arch i386 -arch x86_64 -O3 -march=core2 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.2/include/python2.7 -c simplejson/_speedups.c -o build/temp.macosx-10.7-intel-2.7/simplejson/_speedups.o
    /usr/bin/llvm-gcc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot / -L/usr/local/Cellar/readline/6.2.1/lib build/temp.macosx-10.7-intel-2.7/simplejson/_speedups.o -o build/lib.macosx-10.7-intel-2.7/simplejson/_speedups.so

Successfully installed simplejson
Cleaning up...

╭─(json_test)─○─[Wowbagger.local@Darwin]─[~]─[DON'T PANIC]-[ret:0]─[hist:4270]
╰─[:)]─> ⚡ python                                                                                                                                  ▶▶▶▶▶▶▶▶▶▷
Python 2.7.2 (default, Dec  5 2011, 14:52:41) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import simplejson as json
>>> json.dumps(json.loads('{"hi":"ho"}'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/adam/.virtualenvs/json_test/lib/python2.7/site-packages/simplejson/__init__.py", line 321, in dumps
    return _default_encoder.encode(obj)
  File "/Users/adam/.virtualenvs/json_test/lib/python2.7/site-packages/simplejson/encoder.py", line 237, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/Users/adam/.virtualenvs/json_test/lib/python2.7/site-packages/simplejson/encoder.py", line 301, in iterencode
    Decimal)
TypeError: make_encoder() takes at most 15 arguments (16 given)
>>> 
Bob Ippolito
Owner
etrepum commented May 10, 2012

Thanks for the report. Strangely, all of the tests are passing. Will investigate.

[bob@xiao tmp]$ curl -s http://pypi.python.org/packages/source/s/simplejson/simplejson-2.5.1.tar.gz | tar zxf -
[bob@xiao tmp]$ cd simplejson-2.5.1/
[bob@xiao simplejson-2.5.1]$ python setup.py test
running test
..........................................................................................................................................................................
----------------------------------------------------------------------
Ran 170 tests in 2.055s

OK

http://travis-ci.org/#!/simplejson/simplejson/jobs/1298709
http://travis-ci.org/#!/simplejson/simplejson/jobs/1298710

Bob Ippolito
Owner
etrepum commented May 10, 2012

Please try again, I just cut another release where I can't reproduce this bug.

[bob@xiao ~]$ pip install --upgrade simplejson
Downloading/unpacking simplejson
  Downloading simplejson-2.5.2.tar.gz (53Kb): 53Kb downloaded
  Running setup.py egg_info for package simplejson

Installing collected packages: simplejson
  Found existing installation: simplejson 2.5.1
    Uninstalling simplejson:
      Successfully uninstalled simplejson
  Running setup.py install for simplejson
    building 'simplejson._speedups' extension
    /usr/bin/llvm-gcc -fno-strict-aliasing -O3 -w -pipe -march=core2 -msse4 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.2/include/python2.7 -c simplejson/_speedups.c -o build/temp.macosx-10.4-x86_64-2.7/simplejson/_speedups.o
    /usr/bin/llvm-gcc -bundle -undefined dynamic_lookup -L/usr/local/Cellar/readline/6.2.2/lib build/temp.macosx-10.4-x86_64-2.7/simplejson/_speedups.o -o build/lib.macosx-10.4-x86_64-2.7/simplejson/_speedups.so

Successfully installed simplejson
Cleaning up...
[bob@xiao ~]$ python -c 'import simplejson as json; print json.loads(json.dumps({}))'
{}
Bob Ippolito etrepum closed this May 10, 2012
Adam

the 2.5.2 version is working, thank you

Jonathan Perkin jperkin referenced this issue from a commit in joyent/pkgsrc June 03, 2012
Update to 2.5.2:
Version 2.5.2 released 2012-05-10

* Fix for regression introduced in 2.5.1
  simplejson/simplejson#35

Version 2.5.1 released 2012-05-10

* Support for use_decimal=True in environments that use Python
  sub-interpreters such as uWSGI
  simplejson/simplejson#34

Version 2.5.0 released 2012-03-29

* New item_sort_key option for encoder to allow fine grained control of sorted
  output

Version 2.4.0 released 2012-03-06

* New bigint_as_string option for encoder to trade JavaScript number precision
  issues for type issues.
  simplejson/simplejson#31

Version 2.3.3 released 2012-02-27

* Allow unknown numerical types for indent parameter
  simplejson/simplejson#29

Version 2.3.2 released 2011-12-30

* Fix crashing regression in speedups introduced in 2.3.1

Version 2.3.1 released 2011-12-29

* namedtuple_as_object now checks _asdict to ensure that it
  is callable.
  simplejson/simplejson#26

Version 2.3.0 released 2011-12-05

* Any objects with _asdict() methods are now considered for
  namedtuple_as_object.
  simplejson/simplejson#22
6bc94ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.