[Django] #29635: can't pass int value to QueryDict Instance

3 views
Skip to first unread message

Django

unread,
Aug 4, 2018, 2:51:11 AM8/4/18
to django-...@googlegroups.com
#29635: can't pass int value to QueryDict Instance
-----------------------------------------+------------------------
Reporter: dhcn | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: 2.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
the code
{{{
query_dict["offset"] = self.length
}}}
the querydict is {"offset":[100]}
will give the error:

{{{
File "/usr/local/lib/python3.5/dist-packages/django/http/request.py" in
urlencode
524. for v in list_

File "/usr/local/lib/python3.5/dist-packages/django/http/request.py" in
<genexpr>
524. for v in list_

Exception Type: AttributeError at /zhaohuogan/archives/
Exception Value: 'int' object has no attribute 'encode'
}}}

the bugfixed code is:
{{{
query_dict["offset"] = str(self.length)
}}}

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

Django

unread,
Aug 4, 2018, 5:45:48 AM8/4/18
to django-...@googlegroups.com
#29635: can't pass int value to QueryDict Instance
-------------------------------+--------------------------------------
Reporter: dhcn | Owner: nobody
Type: Bug | Status: closed

Component: HTTP handling | Version: 2.1
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #29627.

--
Ticket URL: <https://code.djangoproject.com/ticket/29635#comment:1>

Reply all
Reply to author
Forward
0 new messages