{{{
...
File "/opt/escape/lib/python3.5/site-
packages/django/contrib/admin/sites.py", line 223, in inner
return view(request, *args, **kwargs)
File "/opt/escape/lib/python3.5/site-
packages/django/utils/decorators.py", line 45, in _wrapper
return bound_method(*args, **kwargs)
File "/opt/escape/lib/python3.5/site-
packages/django/utils/decorators.py", line 142, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "/opt/escape/lib/python3.5/site-
packages/django/contrib/admin/options.py", line 1727, in changelist_view
response = self.response_action(request,
queryset=cl.get_queryset(request))
File "/opt/escape/lib/python3.5/site-
packages/django/contrib/admin/options.py", line 1409, in response_action
queryset = queryset.filter(pk__in=selected)
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/query.py", line 841, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/query.py", line 859, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/sql/query.py", line 1263, in add_q
clause, _ = self._add_q(q_object, self.used_aliases)
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/sql/query.py", line 1287, in _add_q
split_subq=split_subq,
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/sql/query.py", line 1225, in build_filter
condition = self.build_lookup(lookups, col, value)
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/sql/query.py", line 1096, in build_lookup
lookup = lookup_class(lhs, rhs)
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/lookups.py", line 20, in __init__
self.rhs = self.get_prep_lookup()
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/lookups.py", line 210, in get_prep_lookup
rhs_value = self.lhs.output_field.get_prep_value(rhs_value)
File "/opt/escape/lib/python3.5/site-
packages/django/db/models/fields/__init__.py", line 965, in get_prep_value
return int(value)
ValueError: invalid literal for int() with base 10: '1٫600'
}}}
The character `٫` is my persian thousand separator.
--
Ticket URL: <https://code.djangoproject.com/ticket/29578>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Carlton Gibson):
Hi Sassan,
Thanks for the report.
Could you possibly try to bisect the error to see where it was introduced
or create a test case or minimal project demonstrating this so that we can
do so?
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:1>
Comment (by Sassan Haradji):
While I'd love to help with the bisect unfortunately I have zero free time
these days. It should happen for you if you have these lines in your
settings:
{{{
LANGUAGE_CODE = 'fa'
locale.setlocale(locale.LC_ALL, 'fa_IR')
LANGUAGES = (
('fa', 'Farsi'),
)
USE_I18N = True
USE_L10N = True
USE_THOUSAND_SEPARATOR = True
THOUSAND_SEPARATOR = '٫'
NUMBER_GROUPING = 3
}}}
And you're using django 2.1rc1 and you try to remvoe an object with id
>=1000 in django admin list.
It should be the minimal requirements to reproduce the issue but I doubt
it has anything to do with persian langauge and it should happen in other
locales too.
If you weren't able to reproduce the issue just tell me here and I'll try
to find some time to do the bisect.
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:2>
* stage: Unreviewed => Accepted
Comment:
OK. I can reproduce. Bisected to 1b7780ea0802116eeef80b398a0432ac3f0ba9ef.
Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:3>
Comment (by Claude Paroz):
Weird, as the behavior is tested in
https://github.com/django/django/blob/1ed8527e3df930ae54ef237e77f1a53faa0ff5ed/tests/admin_views/test_actions.py#L76
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:4>
* status: new => assigned
* owner: nobody => Claude Paroz
Comment:
OK, the key to reproduce is to set `NUMBER_GROUPING`. My findings is that
the faulty commit just revealed another bug in `numberformat.format()` not
honoring forced l10n usage.
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:5>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/10202 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0adfba968e28cfb4e4d681e658866debbbd68089" 0adfba96]:
{{{
#!CommitTicketReference repository=""
revision="0adfba968e28cfb4e4d681e658866debbbd68089"
Fixed #29578 -- Made numberformat.format() honor forced l10n usage.
Thanks Sassan Haradji for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:8>
Comment (by Sassan Haradji):
Great, thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"1084bcc4b78c0a5810a53a32c9678c3563380c9e" 1084bcc4]:
{{{
#!CommitTicketReference repository=""
revision="1084bcc4b78c0a5810a53a32c9678c3563380c9e"
[2.1.x] Fixed #29578 -- Made numberformat.format() honor forced l10n
usage.
Thanks Sassan Haradji for the report.
Backport of 0adfba968e28cfb4e4d681e658866debbbd68089 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29578#comment:10>