[Zope3-checkins] CVS: Zope3/src/zope/configuration - config.py:1.3

Jim Fulton jim@zope.com
Tue, 29 Jul 2003 15:57:16 -0400


Update of /cvs-repository/Zope3/src/zope/configuration
In directory cvs.zope.org:/tmp/cvs-serv16659/src/zope/configuration

Modified Files:
	config.py 
Log Message:
Added a check for trailing dots in dotted names.
These are no longer allowed. We were giving a cryptic
import error.  I also added a check for empty names.


=== Zope3/src/zope/configuration/config.py 1.2 => 1.3 ===
--- Zope3/src/zope/configuration/config.py:1.2	Tue Jul 29 12:28:54 2003
+++ Zope3/src/zope/configuration/config.py	Tue Jul 29 15:56:42 2003
@@ -115,7 +115,14 @@
         """
         
         name = dottedname.strip()
+        if not name:
+            raise ValueError("The given name is blank")
+        
         names = name.split('.')
+        if not names[-1]:
+            raise ValueError(
+                "Trailing dots are no longer supported in dotted names")
+        
         if not names[0]:
             # Got a relative name. Conver it to abs using package info
             if self.package is None: