For the first case, one way to verify the code is no longer in use is to
run URLValidator on `https://މިހާރު.com`, which is a domain allowed by
IDNA 2008 but prohibited by IDNA 2003. If the punycode() branch were
coming into play, that URL would be rejected:
{{{#!python
from django.core.validators import URLValidator
URLValidator()("https://މިހާރު.com")
# (No error)
from django.utils.encoding import punycode
punycode("މިހާރު.com")
# UnicodeError: Violation of BIDI requirement 3
# encoding with 'idna' codec failed
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36007>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Django
unread,
Dec 12, 2024, 5:57:21 PM12/12/24
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-...@googlegroups.com
#36007: Dead code in URLValidator
-------------------------------------+-------------------------------------
Reporter: Mike Edmunds | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Uncategorized | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-...@googlegroups.com
#36007: Dead code in URLValidator
-------------------------------------+-------------------------------------
Reporter: Mike Edmunds | Owner: (none)
Type: | Status: new
Cleanup/optimization |
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-...@googlegroups.com
#36007: Dead code in URLValidator
-------------------------------------+-------------------------------------
Reporter: Mike Edmunds | Owner: Mike
Type: | Edmunds
In [changeset:"54059125956789ad4c19b77eb7f5cde76eec0643" 5405912]:
{{{#!CommitTicketReference repository=""
revision="54059125956789ad4c19b77eb7f5cde76eec0643"
Fixed #36007 -- Removed dead code from URLValidator.
The "Trivial case failed. Try for possible IDN domain" handling was
obsoleted by ticket-20003, which adjusted the regular expressions to
allow all international domain names (Refs #20003).
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-...@googlegroups.com
#36007: Dead code in URLValidator
-------------------------------------+-------------------------------------
Reporter: Mike Edmunds | Owner: Mike
Type: | Edmunds
Cleanup/optimization | Status: assigned
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
In [changeset:"9a891c387f752b1fa7c4d7b436cd8491e8f16eca" 9a891c38]:
{{{#!CommitTicketReference repository=""
revision="9a891c387f752b1fa7c4d7b436cd8491e8f16eca"
Refs #36007 -- Added IDNA 2008 test case for URLValidator.
Test a domain that is valid under IDNA 2008 but not IDNA 2003. This
helps verify that the branch in URLValidator which calls punycode() is
not actually being used for IDNs. punycode() implements IDNA 2003, so
the domain would fail to validate if that branch were active for IDNs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36007#comment:4>