[Zope3-dev] Re: zope.configuration and ImportErrors

2005-12-04 Thread Florent Guillaume

Florent Guillaume wrote:
Today it's very hard to debug ImportErrors raise inside modules  
referenced through a zcml directive, because the ImportError is  
swallowed an no traceback comes back to the user. Just a
  ConfigurationError: ('Invalid value for', 'class', "Couldn't  import 
some.class, cannot import name somename")

which doesn't point anywhere useful.

I'd like to modify zope.configuration.config to something like:

try:
mod = __import__(mname, *_import_chickens)
except ImportError, v:
+if sys.exc_info()[2].tb_next is not None:
+# ImportError was caused deeper
+raise
raise ConfigurationError, (
"Couldn't import %s, %s" % (mname, v)
), sys.exc_info()[2]

Instead of the simpler code that was there (this nice trick is by  PJE, 
and is used ).


Done: http://svn.zope.org/?rev=40527&view=rev

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Time for a beta!

2005-12-04 Thread Jim Fulton


I think it's time for a beta release of Zope 3.  All of the critical
issues and bugs have been dealt with except for one.  I'm hopeful
that that will be resolved when the person who submitted verifies
that it has been resolved or gives more specific examples of problem
behavior.

Also, it is getting quite late.  We very much want to get the final
release this month.

Stephan, what needs to be done to get a beta out?

Jim

--
Jim Fulton   mailto:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Nuxeo-checkins] r30260 - in CPSSkins/trunk: . skins/cpsskins_cmf

2005-12-04 Thread Jean-Marc Orliaguet

Jean-Marc Orliaguet wrote:


Florent Guillaume wrote:

Redirecting to a relative url is illegal in the HTTP spec. You must  
always use a fully qualified url.


Florent


+redirect_url = REQUEST['HTTP_REFERER'] or '.'
+RESPONSE.redirect(redirect_url)





OK, but can you raise that one zope3-dev? It is used all over the 
place in the zope3 code as a standard way or doing redirection, just 
do a grep on:


$ grep -r  response.redirect Zope3/src

I checked the redirect() method in publisher/http.py and it just sets 
the Location to what it is told to ('.', 'somemethod.html')


/JM


OK, that's the one in Zope3/src/zope/publisher/browser.py that is used...

   def redirect(self, location, status=None):
   base = getattr(self, '_base', '')
   if base and isRelative(str(location)):
   l = base.rfind('/')
   if l >= 0:
   base = base[:l+1]
   else:
   base += '/'
   location = base + location
  
   # TODO: HTTP redirects must provide an absolute location, see
   #   
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
   #   So, what if location is relative and base is unknown?  
Uncomment

   #   the following and you'll see that it actually happens.
   #
   # if isRelative(str(location)):
   # raise AssertionError('Cannot determine absolute location')
  
   return super(BrowserResponse, self).redirect(location, status)


/JM


___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Nuxeo-checkins] r30260 - in CPSSkins/trunk: . skins/cpsskins_cmf

2005-12-04 Thread Jean-Marc Orliaguet

Florent Guillaume wrote:

Redirecting to a relative url is illegal in the HTTP spec. You must  
always use a fully qualified url.


Florent


+redirect_url = REQUEST['HTTP_REFERER'] or '.'
+RESPONSE.redirect(redirect_url)




OK, but can you raise that one zope3-dev? It is used all over the place 
in the zope3 code as a standard way or doing redirection, just do a grep on:


$ grep -r  response.redirect Zope3/src

I checked the redirect() method in publisher/http.py and it just sets 
the Location to what it is told to ('.', 'somemethod.html')


/JM
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com