#32050: reverse() and request.get_full_path() escape URL paths differently -------------------------------------+------------------------------------- Reporter: Jack Cushman | Owner: nobody Type: Bug | Status: closed Component: Core (URLs) | Version: master Severity: Normal | Resolution: duplicate Keywords: reverse, | Triage Stage: get_full_path, escape | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Carlton Gibson):
* status: new => closed * resolution: => duplicate Comment: Thanks for the report. This is delicate, at least. Adjusting the behaviour here leads to various test failures, so to that extent, current behaviour is at least expected. Immediately, you can escape your URL parameters in the call to `reverse()` to avoid the issue: In your script: {{{ correct_url = reverse('deliver_file', args=[file_id, escape_uri_path(correct_title)]) }}} I **think** that this is going to be the required way to go. See particularly the discussion on #18456 — the difference in behaviour between `get_full_path()` and `uri_to_iri()` is known, and it's not clear that `get_full_path()` **can** be implemented to handle all cases. See also #11522, #13260, and #22223, which touch on this. I'm going to close this as a duplicate of #18456. If you want to investigate fully and approach the DevelopersMailingList, if in conclusion you think there's a way to improve the behaviour all things considered then, that would be welcome if you're able to summarize the difficulties. -- Ticket URL: <https://code.djangoproject.com/ticket/32050#comment:1> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.06d182b5d417fadb69cc915739759521%40djangoproject.com.