Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2349 (closed defect: invalid)

Opened 10 years ago

Last modified 10 years ago

Jsonifcation of valid XML data fails

Reported by: kvdb Owned by: chrisz
Priority: normal Milestone:
Component: TurboJson Version: 1.1 HEAD
Severity: normal Keywords:


Not sure which component to file this bug under. But for some API call, TGWS outputs this XML:


<latitude/> <longitude/>


The same output but then requested as JSON format returns the stacktrace below. They problem is in the None types that are rendered in XML as <longitude/>. When I replace None with an empty string, JSON does render correctly. I suspect this is a bug and that None should be handled by the jsonify code.

TurboGears-1.1b3dev_r6583-py2.6.egg/turbogears/controllers.py\", line 96, in _process_output\n fragment=fragment)\n\n

File \"/home/kvdb/public/6pp/env/sevenpp_tg1.1_r6583/lib/python2.6/site-packages/TurboGears-1.1b3dev_r6583-py2.6.egg/turbogears/view/base.py\", line 194, in render return engine.render(kw)

File \"build/bdist.linux-i686/egg/turbojson/jsonsupport.py\", line 40, in render output = self.encoder.encode(info)

File \"build/bdist.linux-i686/egg/simplejson/encoder.py\", line 200, in encode chunks = self.iterencode(o, _one_shot=True)

File \"build/bdist.linux-i686/egg/simplejson/encoder.py\", line 260, in iterencode return _iterencode(o, 0)

File \"build/bdist.linux-i686/egg/turbojson/jsonify.py\", line 163, in default return jsonify(obj)

File \"<generated code>\", line 0, in jsonify

File \"build/bdist.linux-i686/egg/peak/rules/core.py\", line 214, in call raise self.class(*self.args+(args,kw)) # XXX\n\nNoApplicableMethods: ((<api.apiobjects.APIStreet object at 0x9c02cac>,), {}, <bound method ServicesRoot?.get_street of <api.controllers.ServicesRoot? object at 0xb7ed5acc>>)\n\n", "faultcode": "Server", "faultstring": "((<api.apiobjects.APIStreet object at 0x9c02cac>,), {}, <bound method ServicesRoot?.get_street of <api.controllers.ServicesRoot? object at 0xb7ed5acc>>)"}

Change History

comment:1 Changed 10 years ago by chrisz

Please provide more detailed steps and code to reproduce this problem.

comment:2 Changed 10 years ago by Chris Arndt

  • Status changed from new to closed
  • Resolution set to invalid

TGWS is not hosted by the TurboGears project. Please report the issue  http://code.google.com/p/tgws/.

Note: See TracTickets for help on using tickets.