[CMF-checkins] SVN: CMF/branches/2.1/CMFUid/ Merged trunk r84855:84856 into 2.1 branch.

Stefan H. Holek stefan at epy.co.at
Sat Mar 22 15:20:44 EDT 2008


Log message for revision 84857:
  Merged trunk r84855:84856 into 2.1 branch.
  
  Use %r instead of %s in error messages, so we don't trip over non-ASCII
  representations.
  

Changed:
  U   CMF/branches/2.1/CMFUid/UniqueIdHandlerTool.py
  U   CMF/branches/2.1/CMFUid/tests/test_uidhandling.py

-=-
Modified: CMF/branches/2.1/CMFUid/UniqueIdHandlerTool.py
===================================================================
--- CMF/branches/2.1/CMFUid/UniqueIdHandlerTool.py	2008-03-22 19:16:05 UTC (rev 84856)
+++ CMF/branches/2.1/CMFUid/UniqueIdHandlerTool.py	2008-03-22 19:20:43 UTC (rev 84857)
@@ -119,7 +119,7 @@
         UID_ATTRIBUTE_NAME = self.UID_ATTRIBUTE_NAME
         if getattr(aq_base(obj), UID_ATTRIBUTE_NAME, None) is None:
             raise UniqueIdError, \
-                  "No unique id available to be unregistered on '%s'" % obj
+                  "No unique id available to be unregistered on %r" % obj
 
         # delete the uid and reindex
         delattr(obj, UID_ATTRIBUTE_NAME)
@@ -145,7 +145,7 @@
         """
         uid = self.queryUid(obj, None)
         if uid is None:
-            raise UniqueIdError, "No unique id available on '%s'" % obj
+            raise UniqueIdError, "No unique id available on %r" % obj
         return uid
 
     security.declarePrivate('setUid')

Modified: CMF/branches/2.1/CMFUid/tests/test_uidhandling.py
===================================================================
--- CMF/branches/2.1/CMFUid/tests/test_uidhandling.py	2008-03-22 19:16:05 UTC (rev 84856)
+++ CMF/branches/2.1/CMFUid/tests/test_uidhandling.py	2008-03-22 19:20:43 UTC (rev 84857)
@@ -35,6 +35,15 @@
     pass
 
 
+class DummyContent(DummyContent):
+    """Objects may return non-ASCII when converted to str.
+    
+    Think File and Image.
+    """
+    def __str__(self):
+        return u'M\xe4dchen'
+
+
 class UniqueIdHandlerTests(SecurityTest):
 
     def _getTargetClass(self):



More information about the CMF-checkins mailing list