Opened 6 years ago

Closed 6 years ago

#29635 closed Bug (duplicate)

can't pass int value to QueryDict Instance

Reported by: dhcn Owned by: nobody
Component: HTTP handling Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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)

Change History (1)

comment:1 by Tim Graham, 6 years ago

Resolution: → duplicate
Status: new → closed

Duplicate of #29627.

Note: See TracTickets for help on using tickets.
Back to Top