Skip to content

Commit 9bda254

Browse files
kovanclaude
andcommitted
gh-129745: Fix urlparse example to properly parse params
Changed the example from using 'scheme://' to 'http://' so that the params component is correctly parsed. The generic 'scheme' isn't in the list of schemes that support params, so the example was showing params remaining in the path rather than being extracted. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7e2c9bd commit 9bda254

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/urllib.parse.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ or on combining URL components into a URL string.
6969
:options: +NORMALIZE_WHITESPACE
7070

7171
>>> from urllib.parse import urlparse
72-
>>> urlparse("scheme://netloc/path;parameters?query#fragment")
73-
ParseResult(scheme='scheme', netloc='netloc', path='/path;parameters', params='',
72+
>>> urlparse("http://netloc/path;parameters?query#fragment")
73+
ParseResult(scheme='http', netloc='netloc', path='/path', params='parameters',
7474
query='query', fragment='fragment')
7575
>>> o = urlparse("http://docs.python.org:80/3/library/urllib.parse.html?"
7676
... "highlight=params#url-parsing")

0 commit comments

Comments
 (0)