[Zope3-checkins] CVS: Zope3/src/zope/app/services - errorr.py:1.3

Stephan Richter srichter@cbu.edu
Thu, 2 Jan 2003 08:57:39 -0500


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv18351/zope/app/services

Modified Files:
	errorr.py 
Log Message:
Fixed FTP views by commenting out two lines that were too HTTP-specific in 
general code. I know SteveA is working on a fix for it as of now.

Again, this is an outcry that we should start utilizing functional tests!!
The Alpha's FTP support is broken just for these two little entries!


=== Zope3/src/zope/app/services/errorr.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/services/errorr.py:1.2	Wed Dec 25 09:13:19 2002
+++ Zope3/src/zope/app/services/errorr.py	Thu Jan  2 08:57:37 2003
@@ -93,7 +93,10 @@
             username = None
             req_html = None
             if request:
-                url = request.URL
+                # XXX: Temporary fix, which Steve should undo. URL is
+                #      just too HTTPRequest-specific.
+                if hasattr(request, 'URL'):
+                    url = request.URL
                 try:
                     username = ', '.join((request.user.getLogin(),
                                           request.user.getId(),
@@ -103,6 +106,11 @@
                 # When there's an unauthorized access, request.user is
                 # not set, so we get an AttributeError
                 # XXX is this right? Surely request.user should be set!
+                # XXX Answer: Catching AttributeError is correct for the
+                #             simple reason that UnauthenticatedUser (which
+                #             I always use during coding), has no 'getLogin()'
+                #             method. However, for some reason this except
+                #             does **NOT** catch these errors.
                 except AttributeError:
                     pass