Commit fca9a010 authored by Florent Guillaume's avatar Florent Guillaume

Collector #1577: Fixed cryptic error message in ZPublisher if a non-ASCII...

Collector #1577: Fixed cryptic error message in ZPublisher if a non-ASCII string is passed to a date, int, long or float property.
parent 2af706f7
...@@ -41,6 +41,9 @@ Zope Changes ...@@ -41,6 +41,9 @@ Zope Changes
Bugs fixed Bugs fixed
- Collector #1577: Fixed cryptic error message in ZPublisher if a
non-ASCII string is passed to a date, int, long or float property.
- Collector #1576: Fixed Z Search Interface to use proper HTML. - Collector #1576: Fixed Z Search Interface to use proper HTML.
- Collector #1127: strftime did not take timezone into account. - Collector #1127: strftime did not take timezone into account.
......
...@@ -55,7 +55,7 @@ def field2int(v): ...@@ -55,7 +55,7 @@ def field2int(v):
try: return int(v) try: return int(v)
except ValueError: except ValueError:
raise ValueError, ( raise ValueError, (
"An integer was expected in the value '%s'" % escape(v) "An integer was expected in the value %s" % escape(`v`)
) )
raise ValueError, 'Empty entry when <strong>integer</strong> expected' raise ValueError, 'Empty entry when <strong>integer</strong> expected'
...@@ -67,8 +67,8 @@ def field2float(v): ...@@ -67,8 +67,8 @@ def field2float(v):
try: return float(v) try: return float(v)
except ValueError: except ValueError:
raise ValueError, ( raise ValueError, (
"A floating-point number was expected in the value '%s'" % "A floating-point number was expected in the value %s" %
escape(v) escape(`v`)
) )
raise ValueError, ( raise ValueError, (
'Empty entry when <strong>floating-point number</strong> expected') 'Empty entry when <strong>floating-point number</strong> expected')
...@@ -84,7 +84,7 @@ def field2long(v): ...@@ -84,7 +84,7 @@ def field2long(v):
try: return long(v) try: return long(v)
except ValueError: except ValueError:
raise ValueError, ( raise ValueError, (
"A long integer was expected in the value '%s'" % escape(v) "A long integer was expected in the value %s" % escape(`v`)
) )
raise ValueError, 'Empty entry when <strong>integer</strong> expected' raise ValueError, 'Empty entry when <strong>integer</strong> expected'
...@@ -105,7 +105,7 @@ def field2date(v): ...@@ -105,7 +105,7 @@ def field2date(v):
try: try:
v = DateTime(v) v = DateTime(v)
except DateTime.SyntaxError, e: except DateTime.SyntaxError, e:
raise DateTime.SyntaxError, escape(e) raise DateTime.SyntaxError, "Invalid DateTime "+escape(`v`)
return v return v
def field2date_international(v): def field2date_international(v):
...@@ -113,7 +113,7 @@ def field2date_international(v): ...@@ -113,7 +113,7 @@ def field2date_international(v):
try: try:
v = DateTime(v, datefmt="international") v = DateTime(v, datefmt="international")
except DateTime.SyntaxError, e: except DateTime.SyntaxError, e:
raise DateTime.SyntaxError, escape(e) raise DateTime.SyntaxError, "Invalid DateTime "+escape(`v`)
return v return v
def field2boolean(v): def field2boolean(v):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment