urlparse do not support reverse_lazy as url arg
|Reported by:||claudep||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
With Python 2, we could pass a reverse_lazy result (__proxy__ instance) to urlparse and the string conversion was done without problem.
With Python 3, this is failing, because urlparse is feeding url argument to a _coerce_args function which basically run:
if not isinstance(url, str): str.decode(encoding, errors) .
And this is failing with an AttributeError: '__proxy__' object has no attribute 'decode'.
I think it is valuable not to have to explicitely force_text(url) each time we want to pass it to urlparse.
Change History (9)
comment:8 Changed 3 years ago by Aymeric Augustin <aymeric.augustin@…>
- Resolution set to fixed
- Status changed from new to closed