{{{
Exception Type: OverflowError at /path/name/
Exception Value: days=1000000000; must have magnitude <= 999999999
}}}
The full traceback is given below:
{{{
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/project/listing/7/change/
Django Version: 1.10.7
Python Version: 3.5.3
Installed Applications:
['django.contrib.sites',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'project.apps.projectAppConfig']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback:
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/core/handlers/exception.py" in inner
42. response = get_response(request)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e,
request)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/contrib/admin/options.py" in wrapper
544. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/utils/decorators.py" in _wrapped_view
149. response = view_func(request, *args, **kwargs)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/contrib/admin/sites.py" in inner
211. return view(request, *args, **kwargs)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/contrib/admin/options.py" in change_view
1512. return self.changeform_view(request, object_id, form_url,
extra_context)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/utils/decorators.py" in _wrapper
67. return bound_func(*args, **kwargs)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/utils/decorators.py" in _wrapped_view
149. response = view_func(request, *args, **kwargs)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/utils/decorators.py" in bound_func
63. return func.__get__(self, type(self))(*args2,
**kwargs2)
File "/usr/lib/python3.5/contextlib.py" in inner
30. return func(*args, **kwds)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/contrib/admin/options.py" in changeform_view
1441. if form.is_valid():
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/forms/forms.py" in is_valid
169. return self.is_bound and not self.errors
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/forms/forms.py" in errors
161. self.full_clean()
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/forms/forms.py" in full_clean
370. self._clean_fields()
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/forms/forms.py" in _clean_fields
388. value = field.clean(value)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/forms/fields.py" in clean
158. value = self.to_python(value)
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/forms/fields.py" in to_python
498. value = parse_duration(force_text(value))
File "/home/vikas/.virtualenvs/projectname/lib/python3.5/site-
packages/django/utils/dateparse.py" in parse_duration
127. return datetime.timedelta(**kw)
Exception Type: OverflowError at /admin/project/listing/7/change/
Exception Value: days=1000000000; must have magnitude <= 999999999
}}}
If a more ''long'' value is passed as days, the execption message changes
to
{{{
Python int too large to convert to C long
}}}
The expected behaviour would be to raise a `ValidationError` with message
like `Duration is too long` etc.
--
Ticket URL: <https://code.djangoproject.com/ticket/28474>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* cc: Vikas (added)
* type: Uncategorized => Bug
* owner: nobody => Vikas
--
Ticket URL: <https://code.djangoproject.com/ticket/28474#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28474#comment:2>
* owner: v1k45 => Srinivas Reddy Thatiparthy
Comment:
PR has been raised here - https://github.com/django/django/pull/8870
--
Ticket URL: <https://code.djangoproject.com/ticket/28474#comment:3>
Comment (by v1k45):
Replying to [comment:3 Srinivas Reddy Thatiparthy]:
> PR has been raised here - https://github.com/django/django/pull/8870
Hey Srinivas, I assigned it to myself for a reason, I wanted to make my
first contribution to django by it.
You should at least notify the current owner before assigning it to
yourself, the current owner might be already working on it.
That said, the bug was meant to be fixed, doesn't matter who fixes it, so
no hard feelings :)
--
Ticket URL: <https://code.djangoproject.com/ticket/28474#comment:4>
* has_patch: 0 => 1
Comment:
Please check "Has patch" when adding a pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/28474#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"55b5393bd235aa6c55ea9a7da6f0e8b75b204084" 55b5393]:
{{{
#!CommitTicketReference repository=""
revision="55b5393bd235aa6c55ea9a7da6f0e8b75b204084"
Fixed #28474 -- Made DurationField raise ValidationError for inputs that
raised OverflowError.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28474#comment:6>