[rabbitmq-discuss] JSON dependency for codegen - suggestion

Holger Hoffstätte holger at wizards.de
Wed Nov 19 22:52:17 GMT 2008


Esteve Fernandez wrote:
> On Wednesday 19 November 2008 22:57:57 Holger Hoffstätte wrote:
>> Any python wiz who knows what changed from 2.5 to 2.6 that could cause
>> such breakage?
> 
> Not that I would consider myself a wiz, but the problem is that 2.6 comes with 
> a built-in json module.

That's exactly what I just figured out as well after reading Dmitriy's
link. Thanks for the confirmation guys. Apparently 2.6 also has changes to
the import mechanism and whatnot..no wonder I'm chasing ghosts here.

> I'm attaching a patch which makes codegen use simplejson, hope that helps.

sort of.. :}

The patch is missing a closing " but after fixing that I get:

C:\home\holger\Projects\rabbitmq-java-client\build.xml:55: Generation of
AMQP.java failed with message:
Traceback (most recent call last):
  File "codegen.py", line 393, in <module>
    do_main(generateJavaApi, generateJavaImpl)
  File "../rabbitmq-codegen\amqp_codegen.py", line 169, in do_main
    header_fn(sys.argv[2])
  File "codegen.py", line 387, in generateJavaApi
    genJavaApi(AmqpSpec(specPath))
  File "../rabbitmq-codegen\amqp_codegen.py", line 51, in __init__
    self.spec = json.load(file(filename))
  File "C:\Developer\Python\lib\json\__init__.py", line 267, in load
    parse_constant=parse_constant, **kw)
  File "C:\Developer\Python\lib\json\__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "C:\Developer\Python\lib\json\decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Developer\Python\lib\json\decoder.py", line 338, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

The above is with 2.6; I get exactly the same message on 2.5/Linux after
installing simplejson, so at least it's consistent.

Yeah, JSON is really awesome. :->

-h
(scnr)




More information about the rabbitmq-discuss mailing list