Skip to content

gh-144148: Update the urllib.parse documentation#144497

Merged
serhiy-storchaka merged 2 commits intopython:mainfrom
serhiy-storchaka:docs-urllib-parse
Feb 5, 2026
Merged

gh-144148: Update the urllib.parse documentation#144497
serhiy-storchaka merged 2 commits intopython:mainfrom
serhiy-storchaka:docs-urllib-parse

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Feb 5, 2026

Document urlsplit() as the main parsing function and urlparse() as an obsolete variant.


📚 Documentation preview 📚: https://cpython-previews--144497.org.readthedocs.build/

@vstinner
Copy link
Member

vstinner commented Feb 5, 2026

You should update test_urlparse. Example:

FAIL: test_splituser_deprecation (test.test_urlparse.DeprecationTest.test_splituser_deprecation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_urlparse.py", line 1931, in test_splituser_deprecation
    self.assertEqual(str(cm.warning),
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
                     'urllib.parse.splituser() is deprecated as of 3.8, '
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                     'use urllib.parse.urlparse() instead')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'urll[19 chars]) is deprecated as of 3.8, use urllib.parse.urlsplit() instead' != 'urll[19 chars]) is deprecated as of 3.8, use urllib.parse.urlparse() instead'
- urllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlsplit() instead
?                                                                        ^^^^
+ urllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() instead
?                                                                       +++ ^

Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
@serhiy-storchaka
Copy link
Member Author

Sorry, I forget to save the last changes before committing. And did not run the tests.

Copy link
Member

@orsenthil orsenthil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It is a clear and the intention comes across correct at the very high level.

@serhiy-storchaka
Copy link
Member Author

I force-pushed that change because I had not noticed that Victor already started review.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

For the 3.14 backport, I'm not sure that it's a good idea to change deprecation messages. Would it be possible to leave deprecation messages unchanged for the backport?

@serhiy-storchaka serhiy-storchaka merged commit 67ddba9 into python:main Feb 5, 2026
50 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Feb 5, 2026
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 67ddba9aa9c0405c68e691643c4aa75fdbcefe1d 3.14

@serhiy-storchaka serhiy-storchaka deleted the docs-urllib-parse branch February 5, 2026 14:32
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Feb 5, 2026
…GH-144497)

Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
(cherry picked from commit 67ddba9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 5, 2026

GH-144507 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Feb 5, 2026
serhiy-storchaka added a commit that referenced this pull request Feb 5, 2026
…H-144507)

Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
(cherry picked from commit 67ddba9)
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 5, 2026
…GH-144497) (pythonGH-144507)

(cherry picked from commit 2fb9cde)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
(cherry picked from commit 67ddba9)
serhiy-storchaka added a commit that referenced this pull request Feb 5, 2026
…H-144507) (GH-144509)

(cherry picked from commit 2fb9cde)

Document urlsplit() as the main parsing function and urlparse() as
an obsolete variant.
(cherry picked from commit 67ddba9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 CentOS9 NoGIL Refleaks 3.x (tier-1) has failed when building commit 67ddba9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1610/builds/2857) and take a look at the build logs.
  4. Check if the failure is related to this commit (67ddba9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1610/builds/2857

Failed tests:

  • test_free_threading

Test leaking resources:

  • test_free_threading: file descriptors
  • test_free_threading: memory blocks

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 13, done.        
remote: Counting objects:  10% (1/10)        
remote: Counting objects:  20% (2/10)        
remote: Counting objects:  30% (3/10)        
remote: Counting objects:  40% (4/10)        
remote: Counting objects:  50% (5/10)        
remote: Counting objects:  60% (6/10)        
remote: Counting objects:  70% (7/10)        
remote: Counting objects:  80% (8/10)        
remote: Counting objects:  90% (9/10)        
remote: Counting objects: 100% (10/10)        
remote: Counting objects: 100% (10/10), done.        
remote: Compressing objects:  14% (1/7)        
remote: Compressing objects:  28% (2/7)        
remote: Compressing objects:  42% (3/7)        
remote: Compressing objects:  57% (4/7)        
remote: Compressing objects:  71% (5/7)        
remote: Compressing objects:  85% (6/7)        
remote: Compressing objects: 100% (7/7)        
remote: Compressing objects: 100% (7/7), done.        
remote: Total 13 (delta 3), reused 3 (delta 3), pack-reused 3 (from 1)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to '67ddba9aa9c0405c68e691643c4aa75fdbcefe1d'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 67ddba9aa9c gh-144148: Update the urllib.parse documentation (GH-144497)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module

make: *** [Makefile:2524: buildbottest] Error 2

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot s390x Fedora Stable Refleaks 3.x (tier-3) has failed when building commit 67ddba9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1641/builds/1648) and take a look at the build logs.
  4. Check if the failure is related to this commit (67ddba9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1641/builds/1648

Failed tests:

  • test_profiling

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/unittest/case.py", line 666, in run
    with outcome.testPartExecutor(self):
         ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
ResourceWarning: unclosed file <_io.BufferedReader name=8>


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/sample.py", line 59, in __init__
    self.unwinder = self._new_unwinder(native, gc, opcodes, skip_non_matching_threads)
                    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/sample.py", line 74, in _new_unwinder
    return _remote_debugging.RemoteUnwinder(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        self.pid,
        ^^^^^^^^^
    ...<7 lines>...
        **kwargs
        ^^^^^^^^
    )
    ^
RuntimeError: Failed to find the PyRuntime section in process 3618723 on Linux platform


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_profiling/test_sampling_profiler/test_live_collector_ui.py", line 884, in test_run_failed_script_live
    main()
    ~~~~^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 788, in main
    _main()
    ~~~~~^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 922, in _main
    handler(args)
    ~~~~~~~^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 999, in _handle_run
    _handle_live_run(args)
    ~~~~~~~~~~~~~~~~^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 1133, in _handle_live_run
    sample_live(
    ~~~~~~~~~~~^
        process.pid,
        ^^^^^^^^^^^^
    ...<9 lines>...
        blocking=args.blocking,
        ^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/sample.py", line 487, in sample_live
    profiler = SampleProfiler(
        pid,
    ...<8 lines>...
        blocking=blocking,
    )
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/sample.py", line 61, in __init__
    raise SystemExit(err) from err
SystemExit: Failed to find the PyRuntime section in process 3618723 on Linux platform


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 1110, in _handle_live_run
    process = _run_with_sync(cmd, suppress_output=True)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 279, in _run_with_sync
    _wait_for_ready_signal(sync_sock, process, _SYNC_TIMEOUT_SEC)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 219, in _wait_for_ready_signal
    _check_process_died(process)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 207, in _check_process_died
    raise RuntimeError(stderr_msg)
RuntimeError: Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
                     "__main__", mod_spec)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/runpy.py", line 87, in _run_code
    exec(code, run_globals)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/_sync_coordinator.py", line 256, in <module>
    main()
    ~~~~^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/_sync_coordinator.py", line 249, in main
    _execute_script(script_path, script_args, cwd)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/_sync_coordinator.py", line 196, in _execute_script
    exec(code, main_module.__dict__)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/test_python_c0x_aton/tmp8d4kw5na.py", line 1, in <module>
    1/0
    ~^~
ZeroDivisionError: division by zero


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/test/test_profiling/test_sampling_profiler/test_live_collector_ui.py", line 884, in test_run_failed_script_live
    main()
    ~~~~^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 788, in main
    _main()
    ~~~~~^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 922, in _main
    handler(args)
    ~~~~~~~^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 999, in _handle_run
    _handle_live_run(args)
    ~~~~~~~~~~~~~~~~^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/cli.py", line 1112, in _handle_live_run
    sys.exit(f"Error: {e}")
    ~~~~~~~~^^^^^^^^^^^^^^^
SystemExit: Error: Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
                     "__main__", mod_spec)
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/runpy.py", line 87, in _run_code
    exec(code, run_globals)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/_sync_coordinator.py", line 256, in <module>
    main()
    ~~~~^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/_sync_coordinator.py", line 249, in main
    _execute_script(script_path, script_args, cwd)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-s390x.refleak/build/Lib/profiling/sampling/_sync_coordinator.py", line 196, in _execute_script
    exec(code, main_module.__dict__)
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/test_python_c0x_aton/tmp8d4kw5na.py", line 1, in <module>
    1/0
    ~^~
ZeroDivisionError: division by zero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants