Skip to content

Commit d7538dd

Browse files
authored
bpo-35471: Remove the macpath module (GH-11129)
Python 2.4 dropped MacOS 9 support. The macpath module was deprecated in Python 3.7. This change removes it.
1 parent 4aa917c commit d7538dd

File tree

11 files changed

+13
-409
lines changed

11 files changed

+13
-409
lines changed

Doc/library/filesys.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ in this chapter is:
2222
fnmatch.rst
2323
linecache.rst
2424
shutil.rst
25-
macpath.rst
2625

2726

2827
.. seealso::

Doc/library/macpath.rst

Lines changed: 0 additions & 21 deletions
This file was deleted.

Doc/library/os.path.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
.. module:: os.path
55
:synopsis: Operations on pathnames.
66

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).
109

1110
.. index:: single: path; operations
1211

@@ -52,7 +51,6 @@ the :mod:`glob` module.)
5251

5352
* :mod:`posixpath` for UNIX-style paths
5453
* :mod:`ntpath` for Windows paths
55-
* :mod:`macpath` for old-style MacOS paths
5654

5755

5856
.. versionchanged:: 3.8

Doc/whatsnew/3.8.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,9 @@ API and Feature Removals
378378

379379
The following features and APIs have been removed from Python 3.8:
380380

381+
* The :mod:`macpath` module, deprecated in Python 3.7, has been removed.
382+
(Contributed by Victor Stinner in :issue:`35471`.)
383+
381384
* The function :func:`platform.popen` has been removed, it was deprecated since
382385
Python 3.3: use :func:`os.popen` instead.
383386

Lib/macpath.py

Lines changed: 0 additions & 216 deletions
This file was deleted.

Lib/posixpath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
33
Instead of importing this module directly, import os and refer to
44
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),
66
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).
88
99
Some of this can actually be useful on non-Posix systems too, e.g.
1010
for manipulation of the pathname component of URLs.

Lib/test/test_genericpath.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Tests common to genericpath, macpath, ntpath and posixpath
2+
Tests common to genericpath, ntpath and posixpath
33
"""
44

55
import genericpath
@@ -334,7 +334,7 @@ def test_invalid_paths(self):
334334
func(b'/tmp\x00abcds')
335335

336336
# 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).
338338

339339
class CommonTest(GenericTest):
340340
common_attributes = GenericTest.common_attributes + [
@@ -373,8 +373,6 @@ def test_splitdrive(self):
373373
self.assertEqual(splitdrive(b":foo:bar"), (b"", b":foo:bar"))
374374

375375
def test_expandvars(self):
376-
if self.pathmodule.__name__ == 'macpath':
377-
self.skipTest('macpath.expandvars is a stub')
378376
expandvars = self.pathmodule.expandvars
379377
with support.EnvironmentVarGuard() as env:
380378
env.clear()
@@ -407,8 +405,6 @@ def test_expandvars(self):
407405

408406
@unittest.skipUnless(support.FS_NONASCII, 'need support.FS_NONASCII')
409407
def test_expandvars_nonascii(self):
410-
if self.pathmodule.__name__ == 'macpath':
411-
self.skipTest('macpath.expandvars is a stub')
412408
expandvars = self.pathmodule.expandvars
413409
def check(value, expected):
414410
self.assertEqual(expandvars(value), expected)

0 commit comments

Comments
 (0)