On Fri, Mar 17, 2006 at 03:29:59PM -0300, Jorge Godoy wrote:
> 
> 
> Hi!
> 
> 
> After updating to new style files I'm having problems with JSON (I noticed
> that jsonify was removed, what should I replace it for in my code?) and on
> application shutdown.
> 
> For the shutdown I'm getting the following error:
> 
> ================================================================================
> 17/Mar/2006:15:25:00 HTTP INFO HTTP Server shut down
> 17/Mar/2006:15:25:00 ENGINE INFO CherryPy shut down
> Exception in thread Thread-1 (most likely raised during interpreter shutdown):
> Traceback (most recent call last):
>   File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
>   File "/usr/lib/python2.4/threading.py", line 422, in run
>   File "build/bdist.linux-i686/egg/rpy.py", line 112, in r_eventloop
> exceptions.AttributeError: 'NoneType' object has no attribute 'isSet'
> Unhandled exception in thread started by 
> Error in sys.excepthook:
> 
> Original exception was:
> ================================================================================
> 
> There's also an intermitent failure when loading calendar.  This appears just
> on the first instantiation, nothing is changed on the interface AFAICT:
> 
> ================================================================================
> /home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/visit.py:110: 
> DeprecationWarning: visit.key is more likely to be unique than visit.id
>   DeprecationWarning )
> 2006-03-17 15:27:06,207 turbogears.identity DEBUG Retrieving identity for 
> visit: 66
> 2006-03-17 15:27:06,209 turbogears.identity INFO Identity is available...
> /home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/widgets/base.py:152:
>  UserWarning: keyword argument "lang" is unused at 'CalendarDatePicker' 
> instance
>   warnings.warn('keyword argument "%s" is unused at %r instance' % (
> /home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/widgets/base.py:152:
>  UserWarning: keyword argument "labeltext" is unused at 'CalendarDatePicker' 
> instance
>   warnings.warn('keyword argument "%s" is unused at %r instance' % (
> ================================================================================
> 
> For the JSON error:
> 
> ================================================================================
> 17/Mar/2006:15:27:11 HTTP INFO Page handler: <bound method 
> Toxicologia.obterAnalises of 
> <siteamostras.controllers.toxicologia.Toxicologia instance at 0x41babbcc>>
> Traceback (most recent call last):
>   File 
> "/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
>  line 99, in _run
>     self.main()
>   File 
> "/usr/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py",
>  line 248, in main
>     body = page_handler(*virtual_path, **self.params)
>   File "<string>", line 3, in obterAnalises
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py",
>  line 206, in expose
>     output = database.run_with_transaction(expose._expose,func, allow_json, 
> allow_json_from_config,*args, **kw)
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/database.py", 
> line 219, in run_with_transaction
>     retval = func(*args, **kw)
>   File "<string>", line 5, in _expose
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py",
>  line 227, in <lambda>
>     expose._expose.when(rule)(lambda _func, allow_json, 
> allow_json_from_config,*args,**kw: _execute_func(
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py",
>  line 250, in _execute_func
>     return _process_output(output, template, format, content_type, mapping, 
> fragment)
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py",
>  line 55, in _process_output
>     mapping=mapping, content_type=content_type,fragment=fragment)
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/view/base.py",
>  line 77, in render
>     return engine.render(**kw)
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/plugins/json/turbojson/jsonsupport.py",
>  line 27, in render
>     return jsonify.encode(info)
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/plugins/json/turbojson/jsonify.py",
>  line 76, in encode
>     return _instance.encode(obj)
>   File 
> "/usr/lib/python2.4/site-packages/simplejson-1.1-py2.4.egg/simplejson/encoder.py",
>  line 259, in encode
>   File 
> "/usr/lib/python2.4/site-packages/simplejson-1.1-py2.4.egg/simplejson/encoder.py",
>  line 212, in _iterencode
>   File 
> "/usr/lib/python2.4/site-packages/simplejson-1.1-py2.4.egg/simplejson/encoder.py",
>  line 185, in _iterencode_dict
>   File 
> "/usr/lib/python2.4/site-packages/simplejson-1.1-py2.4.egg/simplejson/encoder.py",
>  line 220, in _iterencode
>   File 
> "/usr/lib/python2.4/site-packages/simplejson-1.1-py2.4.egg/simplejson/encoder.py",
>  line 226, in _iterencode_default
>   File 
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/plugins/json/turbojson/jsonify.py",
>  line 71, in default
>     return jsonify(obj)
>   File "<string>", line 5, in jsonify
>   File "_speedups.pyx", line 376, in _speedups.BaseDispatcher.__getitem__
>   File "build/bdist.linux-i686/egg/dispatch/interfaces.py", line 15, in 
> __call__
> NoApplicableMethods: ((JSLink(name='js/MochiKit.js'),), {})
> ================================================================================
> 
> I've checked my configuration files and I've done all what is asked on the
> update page Kevin posted.
> 
> The JSON part is what causes me more trouble since all my AJAX is failing
> now. 

I'd like to add my own error messages to this list:

Traceback (most recent call last):
  File
"/home/jchu/coding/turbogears/thirdparty/cherrypy/cherrypy/_cphttptools.py",
line 99, in _run
    self.main()
  File
"/home/jchu/coding/turbogears/thirdparty/cherrypy/cherrypy/_cphttptools.py",
line 248, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in todotable
  File "/home/jchu/coding/turbogears/turbogears/controllers.py", line 206,
in expose
    output = database.run_with_transaction(expose._expose,func, allow_json,
allow_json_from_config,*args, **kw)
  File "/home/jchu/coding/turbogears/turbogears/database.py", line 219, in
run_with_transaction
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "_speedups.pyx", line 376, in _speedups.BaseDispatcher.__getitem__
  File "build/bdist.linux-i686/egg/dispatch/interfaces.py", line 15, in
__call__
NoApplicableMethods: ((<function todotable at 0xb613609c>, None, False,
(<fatboy.todo.controller.TodoController object at 0xb5eebbec>,), {'filter':
'todofilter.todofilter.todofilter.Types.Types_3,todofilter.todofilter.todofilter.Types.Types_4,todofilter.todofilter.todofilter.Types.Types_5,todofilter.todofilter.todofilter.Types.Types_6,todofilter.todofilter.todofilter.Types.Types_7',
'tg_format': 'json', 'accept':
'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
'search': 'ueo', 'tg_random': '1142620796990'}), {})

This might be because I'm using the fast data controller and adding the
expose json to the default method...

Jason

-- 
If you understand, things are just as they are.  If you do not understand,
things are just as they are.

Attachment: pgp9HjQ7mVXvt.pgp
Description: PGP signature

Reply via email to