[Zope3-checkins] CVS: Zope3/src/zope/schema - _field.py:1.20

Stephan Richter srichter@cosmos.phy.tufts.edu
Sat, 2 Aug 2003 13:25:01 -0400


Update of /cvs-repository/Zope3/src/zope/schema
In directory cvs.zope.org:/tmp/cvs-serv5040/src/zope/schema

Modified Files:
	_field.py 
Log Message:
'DAV:' is a valid URI, so we must accept it. Note that the regex I had in 
my version of the URI field was much more advanced and covered more cases.
We should really consider taking it back in.


=== Zope3/src/zope/schema/_field.py 1.19 => 1.20 ===
--- Zope3/src/zope/schema/_field.py:1.19	Mon Jul 28 18:22:14 2003
+++ Zope3/src/zope/schema/_field.py	Sat Aug  2 13:24:57 2003
@@ -281,8 +281,8 @@
 
 
 _isuri = re.compile(
-    r"[a-zA-z0-9+.-]+://" # scheme
-    r"\S+$"               # non space (should be pickier)
+    r"[a-zA-z0-9+.-]+:"   # scheme
+    r"\S*$"               # non space (should be pickier)
     ).match
 class URI(BytesLine):
     """URI schema field
@@ -294,6 +294,7 @@
         """
         >>> uri = URI(__name__='test')
         >>> uri.validate("http://www.python.org/foo/bar")
+        >>> uri.validate("DAV:")
         >>> uri.validate("www.python.org/foo/bar")
         Traceback (most recent call last):
         ...