﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32904	Tighten up the regular expression used by parse_time to accept less 'invalid' options.	Keryn Knight	Abhyudai	"As per discussion in the ticket #32892 and on the Github comments for same, currently the `time_re` allows for some variations which it arguably shouldn't.

For the historical record's sake, the current regex is: `(?P<hour>\d{1,2}):(?P<minute>\d{1,2})(?::(?P<second>\d{1,2})(?:[\.,](?P<microsecond>\d{1,6})\d{0,6})?)?` where you can see a whole lot of it ends up optional, and there are some ways in which that can be made to accept what we'd probably call 'invalid' (though strictly speaking the result is correct for the input portions):

{{{
>>> from django.utils.dateparse import parse_time
>>> parse_time('0:5: ')
datetime.time(0, 5)
}}}

If possible, we should derive examples of which strings might current pass and decide which, if any of them, shouldn't be accepted. It's probably also fine to leave the whole thing as-is (be liberal in what you accept etc) and just add them as necessary to the examples of valid inputs, so in future it doesn't come up again beyond ""thats just an accepted quirk"""	Bug	closed	Utilities	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
