Opened 9 years ago
Closed 9 years ago
#25424 closed Bug (fixed)
"AttributeError: '__proxy__' object has no attribute 'decode'" using reverse_lazy in test client
Reported by: | Travis Jensen | Owned by: | Travis Jensen |
---|---|---|---|
Component: | Testing framework | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This is basically the same as this bug, just starting from the test client. The relevant stack trace:
Traceback (most recent call last): File "$SRC/tests/test_planner.py", line 49, r = self.client.get(reverse_lazy('generator')) File "$HOME/venvs/webapp/lib/python3.4/site-packages/django/test/client.py", line 500, in get **extra) File "$HOME/venvs/webapp/lib/python3.4/site-packages/django/test/client.py", line 303, in get return self.generic('GET', path, secure=secure, **r) File "$HOME/venvs/webapp/lib/python3.4/site-packages/django/test/client.py", line 357, in generic parsed = urlparse(path) File "$HOME/.pythonz/pythons/CPython-3.4.3/lib/python3.4/urllib/parse.py", line 292, in urlparse url, scheme, _coerce_result = _coerce_args(url, scheme) File "$HOME/.pythonz/pythons/CPython-3.4.3/lib/python3.4/urllib/parse.py", line 112, in _coerce_args return _decode_args(args) + (_encode_result,) File "$HOME/.pythonz/pythons/CPython-3.4.3/lib/python3.4/urllib/parse.py", line 96, in _decode_args return tuple(x.decode(encoding, errors) if x else '' for x in args) AttributeError: '__proxy__' object has no attribute 'decode'
Change History (5)
comment:1 by , 9 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Has patch: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Could you please transform your branch into a pull request ?
Note:
See TracTickets
for help on using tickets.
I've created a reproducer and a fix for this, based on the fix for 18776. It is available at https://github.com/SoftwareMaven/django/tree/ticket_25424.
This is my first foray into contributing to Django, so if there is anything I missed in terms of process and what-not, please let me know.