← All challenges
harddjango/django · v4.1

URLField throws ValueError instead of ValidationError on clean

Try this bug with AI

Fix it in the original repo with an AI agent and get feedback on how you worked.

2 free rounds each week

Round mode
  • Time limit60 min
  • Token budgetup to 1M
  • Worth up to310 XP
Sign up or sign in to start

Read the sample report

From a simulated Django round

You changed code before reproducing the bug.

Run the failing test before the first edit, so you know the failure you are fixing and can tell when it is gone.

Problem statement

Description

forms.URLField( ).clean('////]@N.AN')
results in:
ValueError: Invalid IPv6 URL
Traceback (most recent call last):
File "basic_fuzzer.py", line 22, in TestOneInput
File "fuzzers.py", line 350, in test_forms_URLField
File "django/forms/fields.py", line 151, in clean
File "django/forms/fields.py", line 136, in run_validators
File "django/core/validators.py", line 130, in __call__
File "urllib/parse.py", line 440, in urlsplit

The environment starts at commit 4fd3044ca013 (django/django 4.1), dependencies installed and tests runnable from the first minute. You are graded by hidden tests taken from the fix that was actually merged upstream.