Re: [ANNOUNCE] Django security releases issued (1.4.21, 1.7.9, and 1.8.3)
Tom's question got me thinking. Should non-ASCII numerals be allowed ? import re for x in ("10", "६"): print("INT", int(x)) print("RE", re.match("^-?\d+\Z", x) is not None) On Python 3 this returns True and True unless you add re.ASCII flag. On 10 July 2015 at 12:32, Florian Apollonerwrote: > In [1]: int(' 5 ') > Out[1]: 5 > > Cheers, > Florian > > On Friday, July 10, 2015 at 12:00:20 PM UTC+2, tomv wrote: >> >> Out of interest what's wrong with casting to int and checking for >> exceptions? >> >> This is the removed code: >> >> try: >> int(value) >> except (ValueError, TypeError): >> raise ValidationError(_('Enter a valid integer.'), code='invalid') >> >> Does this match different strings than the new regex: >> re.compile('^-?\d+\Z') ? Or is it more about performance, OverflowError etc? > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > Visit this group at http://groups.google.com/group/django-developers. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/52e4d514-fe86-4867-a640-3484939dd882%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- Łukasz Rekucki -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAEZs-EKrz1heUAoeJfA6GJ6Bg4t6kdH3d5F24UBykU2Y8WOFrw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANNOUNCE] Django security releases issued (1.4.21, 1.7.9, and 1.8.3)
In [1]: int(' 5 ') Out[1]: 5 Cheers, Florian On Friday, July 10, 2015 at 12:00:20 PM UTC+2, tomv wrote: > > Out of interest what's wrong with casting to int and checking for > exceptions? > > This is the removed code: > > try: > int(value) > except (ValueError, TypeError): > raise ValidationError(_('Enter a valid integer.'), code='invalid') > > Does this match different strings than the new regex: > re.compile('^-?\d+\Z') ? Or is it more about performance, OverflowError > etc? > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/52e4d514-fe86-4867-a640-3484939dd882%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ANNOUNCE] Django security releases issued (1.4.21, 1.7.9, and 1.8.3)
Out of interest what's wrong with casting to int and checking for exceptions? This is the removed code: try: int(value) except (ValueError, TypeError): raise ValidationError(_('Enter a valid integer.'), code='invalid') Does this match different strings than the new regex: re.compile('^-?\d+\Z') ? Or is it more about performance, OverflowError etc? -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/fa196dc9-c002-4f4b-9bb3-a0ab64d6ff2d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ANNOUNCE] Django security releases issued (1.4.21, 1.7.9, and 1.8.3)
Today the Django team issued multiple releases -- Django 1.4.21, 1.7.9, and 1.8.3 -- as part of our security process. These releases address a couple security issues, and we encourage all users to upgrade as soon as possible. More details can be found on our blog: https://www.djangoproject.com/weblog/2015/jul/08/security-releases/ As a reminder, we ask that potential security issues be reported via private email to secur...@djangoproject.com, and not via Django's Trac instance or the django-developers list. Please see https://www.djangoproject.com/security for further information. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/729a1bd1-6df2-461e-9883-59ca65188abf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.