Skip to content

bpo-35471: Remove the macpath module #11129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 14, 2018
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
1 change: 0 additions & 1 deletion Doc/library/filesys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ in this chapter is:
fnmatch.rst
linecache.rst
shutil.rst
macpath.rst


.. seealso::
Expand Down
21 changes: 0 additions & 21 deletions Doc/library/macpath.rst

This file was deleted.

6 changes: 2 additions & 4 deletions Doc/library/os.path.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
.. module:: os.path
:synopsis: Operations on pathnames.

**Source code:** :source:`Lib/posixpath.py` (for POSIX),
:source:`Lib/ntpath.py` (for Windows NT),
and :source:`Lib/macpath.py` (for Macintosh)
**Source code:** :source:`Lib/posixpath.py` (for POSIX) and
:source:`Lib/ntpath.py` (for Windows NT).

.. index:: single: path; operations

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

* :mod:`posixpath` for UNIX-style paths
* :mod:`ntpath` for Windows paths
* :mod:`macpath` for old-style MacOS paths


.. versionchanged:: 3.8
Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ API and Feature Removals

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

* The :mod:`macpath` module, deprecated in Python 3.7, has been removed.
(Contributed by Victor Stinner in :issue:`35471`.)

* The function :func:`platform.popen` has been removed, it was deprecated since
Python 3.3: use :func:`os.popen` instead.

Expand Down
216 changes: 0 additions & 216 deletions Lib/macpath.py

This file was deleted.

4 changes: 2 additions & 2 deletions Lib/posixpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. macpath, ntpath).
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
Expand Down
8 changes: 2 additions & 6 deletions Lib/test/test_genericpath.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Tests common to genericpath, macpath, ntpath and posixpath
Tests common to genericpath, ntpath and posixpath
"""

import genericpath
Expand Down Expand Up @@ -334,7 +334,7 @@ def test_invalid_paths(self):
func(b'/tmp\x00abcds')

# Following TestCase is not supposed to be run from test_genericpath.
# It is inherited by other test modules (macpath, ntpath, posixpath).
# It is inherited by other test modules (ntpath, posixpath).

class CommonTest(GenericTest):
common_attributes = GenericTest.common_attributes + [
Expand Down Expand Up @@ -373,8 +373,6 @@ def test_splitdrive(self):
self.assertEqual(splitdrive(b":foo:bar"), (b"", b":foo:bar"))

def test_expandvars(self):
if self.pathmodule.__name__ == 'macpath':
self.skipTest('macpath.expandvars is a stub')
expandvars = self.pathmodule.expandvars
with support.EnvironmentVarGuard() as env:
env.clear()
Expand Down Expand Up @@ -407,8 +405,6 @@ def test_expandvars(self):

@unittest.skipUnless(support.FS_NONASCII, 'need support.FS_NONASCII')
def test_expandvars_nonascii(self):
if self.pathmodule.__name__ == 'macpath':
self.skipTest('macpath.expandvars is a stub')
expandvars = self.pathmodule.expandvars
def check(value, expected):
self.assertEqual(expandvars(value), expected)
Expand Down
Loading