#32904: Tighten up the regular expression used by parse_time to accept less
'invalid' options.
-------------------------------------+-------------------------------------
     Reporter:  Keryn Knight         |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Utilities            |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Keryn Knight):

 Here, for example, is one which parses into a `datetime.time` but I
 wouldn't really expect it to, and whilst the input is nonsense, doesn't
 cause an error like `ValueError: second must be in 0..59` which ''would''
 match my expectations:
 {{{
 >>> from django.utils.dateparse import parse_time
 >>> parse_time('4:18:101')
 datetime.time(4, 18, 10)
 # captured data was {'hour': '4', 'minute': '18', 'second': '10',
 'microsecond': None}
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32904#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.285c5e41645444f51fdb0e4c700fa446%40djangoproject.com.

Reply via email to