[Django] #28572: Form URLField validation fails with valid URL

4 views
Skip to first unread message

Django

unread,
Sep 6, 2017, 6:33:16 AM9/6/17
to django-...@googlegroups.com
#28572: Form URLField validation fails with valid URL
----------------------------------------+------------------------
Reporter: Jani Tiainen | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
Given valid URL http://myapp:8080/ does not validate as valid url. Happens
on 1.8 and 1.11 at least.

{{{
#!python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.test import TestCase
from django import forms

class TestForm(forms.Form):
url = forms.URLField()

class UrlTestCase(TestCase):

def test_form(self):
form = TestForm({'url': 'http://myapp:8080/'})

self.assertTrue(form.is_valid())
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28572>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 6, 2017, 6:35:16 AM9/6/17
to django-...@googlegroups.com
#28572: Form URLField validation fails with valid URL
------------------------------+--------------------------------------

Reporter: Jani Tiainen | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+--------------------------------------
Description changed by Jani Tiainen:

Old description:

> Given valid URL http://myapp:8080/ does not validate as valid url.
> Happens on 1.8 and 1.11 at least.
>
> {{{
> #!python
> # -*- coding: utf-8 -*-
> from __future__ import unicode_literals
>
> from django.test import TestCase
> from django import forms
>
> class TestForm(forms.Form):
> url = forms.URLField()
>
> class UrlTestCase(TestCase):
>
> def test_form(self):
> form = TestForm({'url': 'http://myapp:8080/'})
>
> self.assertTrue(form.is_valid())
> }}}

New description:

Given valid URL http://myapp:8080/ does not validate as valid url. Happens

on 1.8 and 1.11 at least. Note that at if I change localhost in myapp
place, URL validates.

{{{
#!python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.test import TestCase
from django import forms

class TestForm(forms.Form):
url = forms.URLField()

class UrlTestCase(TestCase):

def test_form(self):
form = TestForm({'url': 'http://myapp:8080/'})

self.assertTrue(form.is_valid())
}}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28572#comment:1>

Django

unread,
Sep 6, 2017, 7:09:30 AM9/6/17
to django-...@googlegroups.com
#28572: Form URLField validation fails with valid URL
------------------------------+-----------------------------------------
Reporter: Jani Tiainen | Owner: Denis.Tarykin
Type: Bug | Status: assigned
Component: Forms | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
Changes (by Denis.Tarykin):

* owner: nobody => Denis.Tarykin
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28572#comment:2>

Django

unread,
Sep 6, 2017, 7:59:14 AM9/6/17
to django-...@googlegroups.com
#28572: URLValidator rejects host without tld

------------------------------+-----------------------------------------
Reporter: Jani Tiainen | Owner: Denis.Tarykin
Type: Bug | Status: closed
Component: Core (Other) | Version: 1.11
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
Changes (by Tim Graham):

* status: assigned => closed
* resolution: => duplicate
* component: Forms => Core (Other)


Comment:

Duplicate of #25418.

--
Ticket URL: <https://code.djangoproject.com/ticket/28572#comment:3>

Reply all
Reply to author
Forward
0 new messages