diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 9e682dcad9eac0..bce088fd10e5ef 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -393,7 +393,7 @@ class _NormalAccessor(_Accessor): stat = os.stat - open = os.open + open = io.open listdir = os.listdir @@ -1087,10 +1087,6 @@ def __exit__(self, t, v, tb): # removed in the future. pass - def _opener(self, name, flags, mode=0o666): - # A stub for the opener argument to built-in open() - return self._accessor.open(self, flags, mode) - # Public API @classmethod @@ -1212,8 +1208,8 @@ def open(self, mode='r', buffering=-1, encoding=None, """ if "b" not in mode: encoding = io.text_encoding(encoding) - return io.open(self, mode, buffering, encoding, errors, newline, - opener=self._opener) + return self._accessor.open(self, mode, buffering, encoding, errors, + newline) def read_bytes(self): """