[Checkins] SVN: z3c.bobopublisher/trunk/ New release fixes two important bugs.

Fabio Tranchitella kobold at kobold.it
Sat Aug 22 03:25:59 EDT 2009


Log message for revision 103071:
  New release fixes two important bugs.
  
  - Security middleware: ensure that endInteraction is called even if the
    application raises an exception.
  
  - Publication: ensure that the traversal key is a unicode string, decoding it
    from the request's charset.
  

Changed:
  U   z3c.bobopublisher/trunk/CHANGES.txt
  U   z3c.bobopublisher/trunk/setup.py
  U   z3c.bobopublisher/trunk/src/z3c/bobopublisher/README.txt
  U   z3c.bobopublisher/trunk/src/z3c/bobopublisher/middleware/security.py
  U   z3c.bobopublisher/trunk/src/z3c/bobopublisher/publication.py

-=-
Modified: z3c.bobopublisher/trunk/CHANGES.txt
===================================================================
--- z3c.bobopublisher/trunk/CHANGES.txt	2009-08-21 17:49:31 UTC (rev 103070)
+++ z3c.bobopublisher/trunk/CHANGES.txt	2009-08-22 07:25:57 UTC (rev 103071)
@@ -1,6 +1,15 @@
 CHANGES
 =======
 
+0.1.3 (2009-08-22)
+------------------
+
+- Security middleware: ensure that endInteraction is called even if the
+  application raises an exception.
+
+- Publication: ensure that the traversal key is a unicode string, decoding it
+  from the request's charset.
+
 0.1.2 (2009-08-19)
 ------------------
 

Modified: z3c.bobopublisher/trunk/setup.py
===================================================================
--- z3c.bobopublisher/trunk/setup.py	2009-08-21 17:49:31 UTC (rev 103070)
+++ z3c.bobopublisher/trunk/setup.py	2009-08-22 07:25:57 UTC (rev 103071)
@@ -2,7 +2,7 @@
 
 setup(
     name='z3c.bobopublisher',
-    version='0.1.2',
+    version='0.1.3',
     url='http://pypi.python.org/pypi/z3c.bobopublisher',
     license='ZPL 2.1',
     author='Fabio Tranchitella',

Modified: z3c.bobopublisher/trunk/src/z3c/bobopublisher/README.txt
===================================================================
--- z3c.bobopublisher/trunk/src/z3c/bobopublisher/README.txt	2009-08-21 17:49:31 UTC (rev 103070)
+++ z3c.bobopublisher/trunk/src/z3c/bobopublisher/README.txt	2009-08-22 07:25:57 UTC (rev 103071)
@@ -47,6 +47,7 @@
     >>> class Root(object):
     ...     implements(IRoot, IReadMapping)
     ...     def get(self, name, default=None):
+    ...         assert isinstance(name, unicode)
     ...         return name == u'subitem' and SubItem() or default
     >>> class ISubItem(Interface):
     ...     pass

Modified: z3c.bobopublisher/trunk/src/z3c/bobopublisher/middleware/security.py
===================================================================
--- z3c.bobopublisher/trunk/src/z3c/bobopublisher/middleware/security.py	2009-08-21 17:49:31 UTC (rev 103070)
+++ z3c.bobopublisher/trunk/src/z3c/bobopublisher/middleware/security.py	2009-08-22 07:25:57 UTC (rev 103071)
@@ -56,8 +56,12 @@
     def __call__(self, environ, start_response):
         principal = IPrincipal(environ.get(self.key))
         newInteraction(Participation(principal))
-        result = self.app(environ, start_response)
-        endInteraction()
+        try:
+            result = self.app(environ, start_response)
+        except:
+            raise
+        finally:
+            endInteraction()
         return result
 
 

Modified: z3c.bobopublisher/trunk/src/z3c/bobopublisher/publication.py
===================================================================
--- z3c.bobopublisher/trunk/src/z3c/bobopublisher/publication.py	2009-08-21 17:49:31 UTC (rev 103070)
+++ z3c.bobopublisher/trunk/src/z3c/bobopublisher/publication.py	2009-08-22 07:25:57 UTC (rev 103071)
@@ -67,7 +67,8 @@
     @bobo.subroute('/:name')
     def traverse(self, request, name):
         traverser = IPublishTraverse(self.context)
-        name = name or IDefaultViewName(self.context, u'index.html')
+        name = name.decode(request.charset or 'utf-8') or \
+            IDefaultViewName(self.context, u'index.html')
         try:
             obj = traverser.publishTraverse(request, name)
         except KeyError:



More information about the Checkins mailing list