Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#35280 closed Bug (fixed)

iriencode example incorrect

Reported by: minusf Owned by: Can Huynh
Component: Documentation Version: 5.0
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#iriencode

If value is "?test=1&me=2", the output will be "?test=1&me=2".

This is not the case as by default "&" is a safe character for iriencode: https://github.com/django/django/blob/main/django/utils/encoding.py#L135.

It is urlencode that does that conversion. iriencode is more for non-ascii characters in my understanding, and using both at the same time is supported:

value|urlencode|iriencode

Change History (9)

comment:1 by Mariusz Felisiak, 9 months ago

Triage Stage: UnreviewedAccepted

Good catch, we could use an example from the docstring, '/I ♥ Django/. Would you like to prepare a patch?

comment:2 by Can Huynh, 9 months ago

I would love to help if @minusf couldn't allocate the time. Lmk!

comment:3 by minusf, 9 months ago

there is no monopoly on pull requests, go ahead Can :D

comment:4 by Can Huynh, 9 months ago

Owner: changed from nobody to Can Huynh
Status: newassigned

in reply to:  3 comment:5 by Can Huynh, 9 months ago

Thank you! Preparing the patch now.

Replying to minusf:

there is no monopoly on pull requests, go ahead Can :D

comment:6 by Mariusz Felisiak, 9 months ago

Has patch: set
Patch needs improvement: set

comment:7 by Mariusz Felisiak, 9 months ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 9 months ago

Resolution: fixed
Status: assignedclosed

In a7baa87:

Fixed #35280 -- Improved iriencode filter example in docs.

comment:9 by Mariusz Felisiak <felisiak.mariusz@…>, 9 months ago

In ef23305:

[5.0.x] Fixed #35280 -- Improved iriencode filter example in docs.

Backport of a7baa874d8452859060ecd28c83cecd566f756e3 from main

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