﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32930	URLValidator should accept urls with port number < 10	Wu Haotian	Wu Haotian	"{{{
>>> from django.core.validators import URLValidator
>>> URLValidator()(""https://code.djangoproject.com:1"")
Traceback (most recent call last):
    .....
    raise ValidationError(self.message, code=self.code, params={'value': value})
django.core.exceptions.ValidationError: <unprintable ValidationError object>
}}}

The commit[1] for fixing Ticket #20003 added port length checks in URLValidator, but I didn't see why in the ticket comments or commit description.

Given that:

The URL Standard from WhatWG[2] defines URL Port as: 
    A URL’s port is either null or a 16-bit unsigned integer that identifies a networking port. It is initially null. 

RFC 3986[3] defines ""port"" as ""*DIGIT"", and does not requires the length of port.

I believe URLs with port number < 10 should be valid URLs.

[1] https://github.com/django/django/commit/2e65d56156b622e2393dee1af66e9c799a51924f#diff-d9609d8dc8482b30eac30df16213cba134562949fd62c97573927b89e880f85bR85
[2] https://url.spec.whatwg.org/#concept-url-port
[3] https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3"	Bug	closed	Core (Other)	3.2	Normal	fixed	URLValidator	Collin Anderson Florian Apolloner	Ready for checkin	1	0	0	0	0	0
