bpo-35471: Remove the macpath module (GH-11129) · python/cpython@d7538dd (original) (raw)

11 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ in this chapter is:
22 22 fnmatch.rst
23 23 linecache.rst
24 24 shutil.rst
25 -macpath.rst
26 25
27 26
28 27 .. seealso::
Original file line number Diff line number Diff line change
@@ -4,9 +4,8 @@
4 4 .. module:: os.path
5 5 :synopsis: Operations on pathnames.
6 6
7 -**Source code:** :source:`Lib/posixpath.py` (for POSIX),
8 -:source:`Lib/ntpath.py` (for Windows NT),
9 -and :source:`Lib/macpath.py` (for Macintosh)
7 +**Source code:** :source:`Lib/posixpath.py` (for POSIX) and
8 +:source:`Lib/ntpath.py` (for Windows NT).
10 9
11 10 .. index:: single: path; operations
12 11
@@ -52,7 +51,6 @@ the :mod:`glob` module.)
52 51
53 52 * :mod:`posixpath` for UNIX-style paths
54 53 * :mod:`ntpath` for Windows paths
55 - * :mod:`macpath` for old-style MacOS paths
56 54
57 55
58 56 .. versionchanged:: 3.8
Original file line number Diff line number Diff line change
@@ -378,6 +378,9 @@ API and Feature Removals
378 378
379 379 The following features and APIs have been removed from Python 3.8:
380 380
381 +* The :mod:`macpath` module, deprecated in Python 3.7, has been removed.
382 + (Contributed by Victor Stinner in :issue:`35471`.)
383 +
381 384 * The function :func:`platform.popen` has been removed, it was deprecated since
382 385 Python 3.3: use :func:`os.popen` instead.
383 386
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
2 2
3 3 Instead of importing this module directly, import os and refer to
4 4 this module as os.path. The "os.path" name is an alias for this
5 -module on Posix systems; on other systems (e.g. Mac, Windows),
5 +module on Posix systems; on other systems (e.g. Windows),
6 6 os.path provides the same operations in a manner specific to that
7 -platform, and is an alias to another module (e.g. macpath, ntpath).
7 +platform, and is an alias to another module (e.g. ntpath).
8 8
9 9 Some of this can actually be useful on non-Posix systems too, e.g.
10 10 for manipulation of the pathname component of URLs.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1 1 """
2 -Tests common to genericpath, macpath, ntpath and posixpath
2 +Tests common to genericpath, ntpath and posixpath
3 3 """
4 4
5 5 import genericpath
@@ -334,7 +334,7 @@ def test_invalid_paths(self):
334 334 func(b'/tmp\x00abcds')
335 335
336 336 # Following TestCase is not supposed to be run from test_genericpath.
337 -# It is inherited by other test modules (macpath, ntpath, posixpath).
337 +# It is inherited by other test modules (ntpath, posixpath).
338 338
339 339 class CommonTest(GenericTest):
340 340 common_attributes = GenericTest.common_attributes + [
@@ -373,8 +373,6 @@ def test_splitdrive(self):
373 373 self.assertEqual(splitdrive(b":foo:bar"), (b"", b":foo:bar"))
374 374
375 375 def test_expandvars(self):
376 -if self.pathmodule.__name__ == 'macpath':
377 -self.skipTest('macpath.expandvars is a stub')
378 376 expandvars = self.pathmodule.expandvars
379 377 with support.EnvironmentVarGuard() as env:
380 378 env.clear()
@@ -407,8 +405,6 @@ def test_expandvars(self):
407 405
408 406 @unittest.skipUnless(support.FS_NONASCII, 'need support.FS_NONASCII')
409 407 def test_expandvars_nonascii(self):
410 -if self.pathmodule.__name__ == 'macpath':
411 -self.skipTest('macpath.expandvars is a stub')
412 408 expandvars = self.pathmodule.expandvars
413 409 def check(value, expected):
414 410 self.assertEqual(expandvars(value), expected)