File: url-2.5.4.patch

package info (click to toggle)
pydantic-core 2.27.2-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,428 kB
  • sloc: python: 32,538; javascript: 210; makefile: 149
file content (71 lines) | stat: -rw-r--r-- 3,620 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From: David Hewitt <mail@davidhewitt.dev>
Date: Wed, 18 Dec 2024 09:23:13 +0000
Subject: Bump url from 2.5.2 to 2.5.4

Update URL error messages.

Origin: upstream, https://github.com/pydantic/pydantic-core/pull/1585
Bug-Debian: https://bugs.debian.org/1101417
Last-Update: 2025-04-06
---
 Cargo.toml                   |  2 +-
 tests/validators/test_url.py | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Cargo.toml b/Cargo.toml
index 76ffb72..a27ddc7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -39,7 +39,7 @@ serde = { version = "1.0.214", features = ["derive"] }
 speedate = "0.15.0"
 smallvec = "1.13.2"
 ahash = "0.8.10"
-url = "2.5.0"
+url = "2.5.4"
 # idna is already required by url, added here to be explicit
 idna = "1.0.2"
 base64 = "0.22.1"
diff --git a/tests/validators/test_url.py b/tests/validators/test_url.py
index 59489dd..98be91e 100644
--- a/tests/validators/test_url.py
+++ b/tests/validators/test_url.py
@@ -125,9 +125,9 @@ def url_test_case_helper(
         ('http://1...1', Err('invalid IPv4 address')),
         ('https://[2001:0db8:85a3:0000:0000:8a2e:0370:7334[', Err('invalid IPv6 address')),
         ('https://[', Err('invalid IPv6 address')),
-        ('https://example com', Err('invalid domain character')),
-        ('http://exam%ple.com', Err('invalid domain character')),
-        ('http:// /', Err('invalid domain character')),
+        ('https://example com', Err('invalid international domain name')),
+        ('http://exam%ple.com', Err('invalid international domain name')),
+        ('http:// /', Err('invalid international domain name')),
         ('/more', Err('relative URL without a base')),
         ('http://example.com./foobar', {'str()': 'http://example.com./foobar'}),
         # works since we're in lax mode
@@ -172,7 +172,7 @@ def url_test_case_helper(
         ('https:more', {'str()': 'https://more/', 'host': 'more'}),
         ('file:///foobar', {'str()': 'file:///foobar', 'host': None, 'unicode_host()': None}),
         ('file:///:80', {'str()': 'file:///:80'}),
-        ('file://:80', Err('invalid domain character')),
+        ('file://:80', Err('invalid international domain name')),
         ('foobar://:80', Err('empty host')),
         # with bashslashes
         ('file:\\\\foobar\\more', {'str()': 'file://foobar/more', 'host': 'foobar', 'path': '/more'}),
@@ -383,7 +383,7 @@ def strict_url_validator_fixture():
         ('https:/more', Err('expected //', 'url_syntax_violation')),
         ('https:more', Err('expected //', 'url_syntax_violation')),
         ('file:///foobar', {'str()': 'file:///foobar', 'host': None, 'unicode_host()': None}),
-        ('file://:80', Err('invalid domain character', 'url_parsing')),
+        ('file://:80', Err('invalid international domain name', 'url_parsing')),
         ('file:/xx', Err('expected // after file:', 'url_syntax_violation')),
         ('foobar://:80', Err('empty host', 'url_parsing')),
         ('mongodb+srv://server.example.com/', 'mongodb+srv://server.example.com/'),
@@ -1046,7 +1046,7 @@ def test_zero_schemas():
         (
             'http://127.0.0.1%0d%0aConnection%3a%20keep-alive',
             # dict(scheme='http', host='127.0.0.1%0d%0aconnection%3a%20keep-alive'), CHANGED
-            Err('Input should be a valid URL, invalid domain character [type=url_parsing,'),
+            Err('Input should be a valid URL, invalid international domain name [type=url_parsing,'),
         ),
         # NodeJS unicode -> double dot
         ('http://google.com/\uff2e\uff2e/abc', dict(scheme='http', host='google.com', path='/%EF%BC%AE%EF%BC%AE/abc')),