[Zope3-Users] mkzopeapp and zope.publisher/zope.exceptions incompatibility?

2007-07-07 Thread Marius Gedminas
After reading Philipp's excellent post about mkzopeapp[1] I decided to
give it a try.

  [1] 
http://www.z3lab.org/sections/blogs/philipp-weitershausen/2007_07_07_death-to-instances

Here's what I did on a fresh Ubuntu Feisty machine:

  apt-get install python-setuptools
  easy_install --prefix /usr/local workingenv.py
  mkdir ~/src
  cd ~/src/
  workingenv playing-with-mkzopeapp
  cd playing-with-mkzopeapp/
  source bin/activate
  easy_install mkzopeapp
  cd src/
  mkzopeapp sampleproject
  cd sampleproject/
  python setup.py develop -f http://download.zope.org/distribution
  startsampleproject

I didn't expect it to work (workingenv and easy_install both use
/usr/bin/python, which is 2.5, and I don't think Zope 3 works on 2.5
yet), but it failed with an error I didn't expect:

  Traceback (most recent call last):
File /home/mg/src/playing-with-mkzopeapp/bin/startsampleproject, line 14, 
in module
  load_entry_point('sampleproject==0.1', 'console_scripts', 
'startsampleproject')()
File 
/home/mg/src/playing-with-mkzopeapp/src/sampleproject/sampleproject/main.py, 
line 8, in main
  paste.script.command.run(['serve', conf_file])
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteScript-1.3.5-py2.5.egg/paste/script/command.py,
 line 76, in run
  invoke(command, command_name, options, args[1:])
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteScript-1.3.5-py2.5.egg/paste/script/command.py,
 line 115, in invoke
  exit_code = runner.run(args)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteScript-1.3.5-py2.5.egg/paste/script/command.py,
 line 210, in run
  result = self.command()
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteScript-1.3.5-py2.5.egg/paste/script/serve.py,
 line 231, in command
  relative_to=base, global_conf=vars)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteScript-1.3.5-py2.5.egg/paste/script/serve.py,
 line 254, in loadapp
  **kw)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 193, in loadapp
  return loadobj(APP, uri, name=name, **kw)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 213, in loadobj
  global_conf=global_conf)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 237, in loadcontext
  global_conf=global_conf)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 267, in _loadconfig
  return loader.get_context(object_type, name, global_conf)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 393, in get_context
  section)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 415, in _context_from_use
  object_type, name=use, global_conf=global_conf)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 345, in get_context
  global_conf=global_conf)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 237, in loadcontext
  global_conf=global_conf)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 274, in _loadegg
  return loader.get_context(object_type, name, global_conf)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 542, in get_context
  object_type, name=name)
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/PasteDeploy-1.3.1-py2.5.egg/paste/deploy/loadwsgi.py,
 line 568, in find_egg_entry_point
  possible.append((entry.load(), protocol, entry.name))
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/setuptools-0.6c6-py2.5.egg/pkg_resources.py,
 line 1912, in load
  entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/zope.paste-0.3-py2.5.egg/zope/paste/factory.py,
 line 22, in module
  from zope.app.wsgi import WSGIPublisherApplication
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/zope.app.wsgi-3.4.0a1_2-py2.5.egg/zope/app/wsgi/__init__.py,
 line 28, in module
  from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/zope.app.publication-3.4.0a1_2-py2.5.egg/zope/app/publication/httpfactory.py,
 line 23, in module
  from zope.publisher.browser import setDefaultSkin
File 
/home/mg/src/playing-with-mkzopeapp/lib/python2.5/zope.publisher-3.4.0b2-py2.5.egg/zope/publisher/browser.py,
 line 47, in module
  from zope.publisher.http 

Re: [Zope3-Users] ForbiddenAttribute error

2007-07-07 Thread Hermann Himmelbauer
Am Freitag, 6. Juli 2007 16:29 schrieb Mikael Moutakis:
 Hello
 I wrote a feed aggregator using the module FeedParser. I stored the RSS
 feed url in a persistant content component and retrieved the feed data in
 the view class. But I thought that I should move the feed data into the
 content component class instead of retrieving it in the view class. I get a
 ForbiddenAttribute error when viewing the class

Please note, that ForbiddenAttribute is also raised, when an object has no 
such attribute. I'd recommend to check (e.g. via dir(object)) if the 
attribute really exists.

I'm no expert in Zope security, but I assume that ForbiddenAttribute is 
raised, as no permission is known for the attribute, simply, because it does 
not exist.

Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users