Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 81 additions & 135 deletions Doc/library/urllib.parse.rst

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Doc/library/venv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ subclass which installs setuptools and pip into a created virtual environment::
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.parse import urlsplit
from urllib.request import urlretrieve
import venv

Expand Down Expand Up @@ -621,7 +621,7 @@ subclass which installs setuptools and pip into a created virtual environment::
stream.close()

def install_script(self, context, name, url):
_, _, path, _, _, _ = urlparse(url)
_, _, path, _, _ = urlsplit(url)
fn = os.path.split(path)[-1]
binpath = context.bin_path
distpath = os.path.join(binpath, fn)
Expand Down
5 changes: 5 additions & 0 deletions Doc/library/wsgiref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

--------------

.. warning::

:mod:`wsgiref` is a reference implementation and is not recommended for
production. The module only implements basic security checks.

The Web Server Gateway Interface (WSGI) is a standard interface between web
server software and web applications written in Python. Having a standard
interface makes it easy to use an application that supports WSGI with a number
Expand Down
8 changes: 4 additions & 4 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -968,10 +968,10 @@ unittest
urllib.parse
------------

* Add the *missing_as_none* parameter to :func:`~urllib.parse.urlparse`,
:func:`~urllib.parse.urlsplit` and :func:`~urllib.parse.urldefrag` functions.
Add the *keep_empty* parameter to :func:`~urllib.parse.urlunparse` and
:func:`~urllib.parse.urlunsplit` functions.
* Add the *missing_as_none* parameter to :func:`~urllib.parse.urlsplit`,
:func:`~urllib.parse.urlparse` and :func:`~urllib.parse.urldefrag` functions.
Add the *keep_empty* parameter to :func:`~urllib.parse.urlunsplit` and
:func:`~urllib.parse.urlunparse` functions.
This allows to distinguish between empty and not defined URI components
and preserve empty components.
(Contributed by Serhiy Storchaka in :gh:`67041`.)
Expand Down
18 changes: 9 additions & 9 deletions Lib/test/test_urlparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1916,63 +1916,63 @@ def test_splittype_deprecation(self):
urllib.parse.splittype('')
self.assertEqual(str(cm.warning),
'urllib.parse.splittype() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splithost_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splithost('')
self.assertEqual(str(cm.warning),
'urllib.parse.splithost() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splituser_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splituser('')
self.assertEqual(str(cm.warning),
'urllib.parse.splituser() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splitpasswd_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splitpasswd('')
self.assertEqual(str(cm.warning),
'urllib.parse.splitpasswd() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splitport_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splitport('')
self.assertEqual(str(cm.warning),
'urllib.parse.splitport() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splitnport_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splitnport('')
self.assertEqual(str(cm.warning),
'urllib.parse.splitnport() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splitquery_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splitquery('')
self.assertEqual(str(cm.warning),
'urllib.parse.splitquery() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splittag_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splittag('')
self.assertEqual(str(cm.warning),
'urllib.parse.splittag() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splitattr_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.splitattr('')
self.assertEqual(str(cm.warning),
'urllib.parse.splitattr() is deprecated as of 3.8, '
'use urllib.parse.urlparse() instead')
'use urllib.parse.urlsplit() instead')

def test_splitvalue_deprecation(self):
with self.assertWarns(DeprecationWarning) as cm:
Expand Down
24 changes: 13 additions & 11 deletions Lib/urllib/parse.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Parse (absolute and relative) URLs.

urlparse module is based upon the following RFC specifications.
urllib.parse module is based upon the following RFC specifications.

RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L. Masinter, January 2005.
Expand All @@ -20,7 +20,7 @@
McCahill, December 1994

RFC 3986 is considered the current standard and any future changes to
urlparse module should conform with it. The urlparse module is
urllib.parse module should conform with it. The urllib.parse module is
currently not entirely compliant with this RFC due to defacto
scenarios for parsing, and for backward compatibility purposes, some
parsing quirks from older RFCs are retained. The testcases in
Expand Down Expand Up @@ -463,6 +463,8 @@ def urlparse(url, scheme=None, allow_fragments=True, *, missing_as_none=_MISSING
path or query.

Note that % escapes are not expanded.

urlsplit() should generally be used instead of urlparse().
"""
url, scheme, _coerce_result = _coerce_args(url, scheme)
if url is None:
Expand Down Expand Up @@ -1233,7 +1235,7 @@ def unwrap(url):

def splittype(url):
warnings.warn("urllib.parse.splittype() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splittype(url)

Expand All @@ -1254,7 +1256,7 @@ def _splittype(url):

def splithost(url):
warnings.warn("urllib.parse.splithost() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splithost(url)

Expand All @@ -1277,7 +1279,7 @@ def _splithost(url):

def splituser(host):
warnings.warn("urllib.parse.splituser() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splituser(host)

Expand All @@ -1290,7 +1292,7 @@ def _splituser(host):

def splitpasswd(user):
warnings.warn("urllib.parse.splitpasswd() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splitpasswd(user)

Expand All @@ -1303,7 +1305,7 @@ def _splitpasswd(user):

def splitport(host):
warnings.warn("urllib.parse.splitport() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splitport(host)

Expand All @@ -1326,7 +1328,7 @@ def _splitport(host):

def splitnport(host, defport=-1):
warnings.warn("urllib.parse.splitnport() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splitnport(host, defport)

Expand All @@ -1350,7 +1352,7 @@ def _splitnport(host, defport=-1):

def splitquery(url):
warnings.warn("urllib.parse.splitquery() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splitquery(url)

Expand All @@ -1365,7 +1367,7 @@ def _splitquery(url):

def splittag(url):
warnings.warn("urllib.parse.splittag() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splittag(url)

Expand All @@ -1380,7 +1382,7 @@ def _splittag(url):

def splitattr(url):
warnings.warn("urllib.parse.splitattr() is deprecated as of 3.8, "
"use urllib.parse.urlparse() instead",
"use urllib.parse.urlsplit() instead",
DeprecationWarning, stacklevel=2)
return _splitattr(url)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update bundled `libexpat <https://libexpat.github.io/>`_ to 2.7.4
40 changes: 20 additions & 20 deletions Misc/sbom.spdx.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Modules/expat/COPYING
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
Copyright (c) 2001-2022 Expat maintainers
Copyright (c) 2001-2025 Expat maintainers

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
4 changes: 2 additions & 2 deletions Modules/expat/expat.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
Copyright (c) 2016-2026 Sebastian Pipping <sebastian@pipping.org>
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de>
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
Expand Down Expand Up @@ -1082,7 +1082,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
*/
# define XML_MAJOR_VERSION 2
# define XML_MINOR_VERSION 7
# define XML_MICRO_VERSION 3
# define XML_MICRO_VERSION 4

# ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/expat/expat_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* distribution.
*/
#ifndef EXPAT_CONFIG_H
#define EXPAT_CONFIG_H
#define EXPAT_CONFIG_H 1

#include <pyconfig.h>
#ifdef WORDS_BIGENDIAN
Expand Down
Loading
Loading