[https://docs.djangoproject.com/en/1.5/ref/class-based-views/generic-
editing/#deleteview]
When run with Python 3.2, an exception is raised::
'''AttributeError''': '__proxy__' object has no attribute 'decode'
This view raises AttributeError when run under Python 3.2 and later::
{{{
# views.py
class LazyAuthorDelete(generic.DeleteView):
model = Author
success_url = reverse_lazy('authors_list')
}}}
This regression test demonstrates the bug when run under Python 3.2. When
run
with Python 2.7 there are no exceptions raised.
https://github.com/kelvinwong-
ca/django/commit/42f5b7e0275659b4a2400a4a9c79beb7f26c0d42
The trace produced is on Pastebin
--
Ticket URL: <https://code.djangoproject.com/ticket/22693>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
This issue may be related to:
#19378 ''HttpResponseRedirect fail on reverse_lazy with Python 3.2''
That ticket fixed an issue with FormView where Python 3.2 urlparse had
difficulty with the lazy object. This bug is similar.
I propose that the issue is in the DeletionMixin.get_success_url method
returning the lazy object. It too needs force_text to return a non-lazy
URL.
https://github.com/kelvinwong-
ca/django/commit/38b13a314491eb3e27ae13afd853b8f74f277c03
--
Ticket URL: <https://code.djangoproject.com/ticket/22693#comment:1>
* has_patch: 0 => 1
* type: Uncategorized => Bug
* needs_tests: 0 => 1
Comment:
Hi,
This was (accidentally) fixed in 1.6 by
a10f3908042a71ec5ef81bf76f0f278ca5e7a596.
Considering that 1.4 had no support for Python 3, this means that 1.5 is
the only version affected by this bug.
If I'm reading our support policy [1] right, 1.5 only receives security
fixes at this point (and once 1.7 is realeased, it won't be supported at
all anymore) so I'm not sure how to move this ticket forward.
If we do decide to fix this in the 1.5 branch, your proposed patch looks
good but it will need a testcase.
Thanks.
[1] https://docs.djangoproject.com/en/dev/internals/release-process
/#supported-versions
--
Ticket URL: <https://code.djangoproject.com/ticket/22693#comment:2>
* status: new => closed
* resolution: => wontfix
Comment:
Considering 1.5 maintenance status, "experimental" Python 3 support in
1.5, and the possibility to workaround that issue, I'm closing the ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/22693#comment:3>