I'm using Formencode within a pylons implementation and I'm getting an unexpected exception:
File '/opt/local/ ... encode/api.py', line 368 in to_python value = tp(value, state) File '/opt/local/ ... FormEncode-0.7.1-py2.4.egg/formencode/ validators.py', line 1631 in _to_python return self.convert_day(value, state) File '/opt/local/L ... ges/FormEncode-0.7.1-py2.4.egg/formencode/ validators.py', line 1644 in convert_day month = int(match.group(2)) ValueError: invalid literal for int(): Oct In looking through the code for DateConverter ( http://formencode.org/formencode/validators.py.html?f=1737&l=1914#1737 ) I see that the error is being thrown in the convert_day method (line 1830) 1829 try: 1830 month = int(match.group(2)) 1831 except TypeError: 1832 month = self.make_month(match.group(2), state) 1833 else: 1834 if self.month_style == 'mm/dd/yyyy': 1835 month, day = day, month It catches a TypeError exception, but I'm getting a ValueError exception... would it make sense to catch both of these exceptions on line 1831? Or am I doing something wrong? Oh, the date string I'm passing in is "01.Oct.2008" Thanks, Matt Haggard --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
