Ticket #16123: patch.diff

File patch.diff, 1.3 KB (added by Gene, 13 years ago)
Line 
1@@ -359,7 +359,7 @@
2 return value
3 for format in self.input_formats or formats.get_format('DATE_INPUT_FORMATS'):
4 try:
5- return datetime.date(*time.strptime(value, format)[:3])
6+ return datetime.date(*time.strptime(value.encode('utf8'), format)[:3])
7 except ValueError:
8 continue
9 raise ValidationError(self.error_messages['invalid'])
10@@ -385,7 +385,7 @@
11 return value
12 for format in self.input_formats or formats.get_format('TIME_INPUT_FORMATS'):
13 try:
14- return datetime.time(*time.strptime(value, format)[3:6])
15+ return datetime.time(*time.strptime(value.encode('utf8'), format)[3:6])
16 except ValueError:
17 continue
18 raise ValidationError(self.error_messages['invalid'])
19@@ -421,7 +421,7 @@
20 value = '%s %s' % tuple(value)
21 for format in self.input_formats or formats.get_format('DATETIME_INPUT_FORMATS'):
22 try:
23- return datetime.datetime(*time.strptime(value, format)[:6])
24+ return datetime.datetime(*time.strptime(value.encode('utf8'), format)[:6])
25 except ValueError:
26 continue
27 raise ValidationError(self.error_messages['invalid'])
Back to Top