Set:

  WSGIApplicationGroup %{GLOBAL}

This will force your TG instance to run in Python main interpreter.

This is needed in your case as you appear to be using a third party C
extension module for Python which isn't implemented properly to allow
it to be used in Python sub interpreters. Ie., it would like it will
only work in the Python main interpreter.

That this is the problem is suggested by the error:

  RuntimeError:  class.__dict__ not accessible in restricted mode

which can come about when certain types of Python objects are reused
in a Python interpreter they were not originally created for.

Anyway, give that a try.

Graham

On Jun 7, 2:56 pm, Luke Macken <[email protected]> wrote:
> Hey guys,
>
> I'm hitting the following traceback when trying to deploy a
> TurboGears2 app with mod_wsgi.  Any help would be much appreciated.
>
> WSGIDaemonProcess fedoracommunity user=apache maximum-requests=1000
> display-name=fedoracommunity processes=1 threads=1
>
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> (pid=1245): Target WSGI script '/usr/share/fedoracommunity/
> fedoracommunity.wsgi' cannot be loaded as Python module.
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] mod_wsgi
> (pid=1245): Exception occurred processing WSGI script '/usr/share/
> fedoracommunity/fedoracommunity.wsgi'.
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] Traceback (most
> recent call last):
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> share/fedoracommunity/fedoracommunity.wsgi", line 9, in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     application
> = loadapp('config:/etc/fedoracommunity/production.ini')
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 204, in
> loadapp
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     return
> loadobj(APP, uri, name=name, **kw)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 225, in
> loadobj
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     return
> context.create()
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 625, in
> create
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     return
> self.object_type.invoke(self)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/paste/deploy/loadwsgi.py", line 110, in
> invoke
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     return
> fix_call(context.object, context.global_conf, **context.local_conf)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/paste/deploy/util/fixtypeerror.py", line
> 57, in fix_call
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     val =
> callable(*args, **kw)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/fedoracommunity/config/middleware.py",
> line 26, in make_app
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> full_stack=full_stack,
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/tg/configuration.py", line 604, in
> make_base_app
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     app =
> self.add_tm_middleware(app)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/tg/configuration.py", line 531, in
> add_tm_middleware
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     from
> repoze.tm import make_tm
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/repoze/tm/__init__.py", line 2, in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     import
> transaction
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/transaction/__init__.py", line 19, in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     from
> transaction._transaction import Transaction
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/transaction/_transaction.py", line 625,
> in ?
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     class
> Savepoint:
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/zope/interface/advice.py", line 132, in
> advise
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     return
> callback(newClass)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/zope/interface/declarations.py", line 484,
> in _implements_advice
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]
> classImplements(cls, *interfaces)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/zope/interface/declarations.py", line 460,
> in classImplements
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     spec =
> implementedBy(cls)
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]   File "/usr/
> lib/python2.4/site-packages/zope/interface/declarations.py", line 300,
> in implementedByFallback
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99]     spec =
> cls.__dict__.get('__implemented__')
> [Sun Jun 07 04:45:18 2009] [error] [client 10.8.34.99] RuntimeError:
> class.__dict__ not accessible in restricted mode
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to