mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
Issue #13374: Deprecate os.getcwdb() on Windows
This commit is contained in:
parent
345379a7f8
commit
f7c5ae2257
3 changed files with 8 additions and 2 deletions
|
|
@ -264,8 +264,10 @@ def test_abspath(self):
|
|||
self.assertIn(b"foo", self.pathmodule.abspath(b"foo"))
|
||||
|
||||
# Abspath returns bytes when the arg is bytes
|
||||
for path in (b'', b'foo', b'f\xf2\xf2', b'/foo', b'C:\\'):
|
||||
self.assertIsInstance(self.pathmodule.abspath(path), bytes)
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
for path in (b'', b'foo', b'f\xf2\xf2', b'/foo', b'C:\\'):
|
||||
self.assertIsInstance(self.pathmodule.abspath(path), bytes)
|
||||
|
||||
def test_realpath(self):
|
||||
self.assertIn("foo", self.pathmodule.realpath("foo"))
|
||||
|
|
|
|||
|
|
@ -1638,6 +1638,7 @@ def test_deprecated(self):
|
|||
(os.access, filename, os.R_OK),
|
||||
(os.chdir, filename),
|
||||
(os.chmod, filename, 0o777),
|
||||
(os.getcwdb,),
|
||||
(os.link, filename, filename),
|
||||
(os.listdir, filename),
|
||||
(os.lstat, filename),
|
||||
|
|
|
|||
|
|
@ -2410,6 +2410,9 @@ posix_getcwd(int use_bytes)
|
|||
if (wbuf2 != wbuf) free(wbuf2);
|
||||
return resobj;
|
||||
}
|
||||
|
||||
if (win32_warn_bytes_api())
|
||||
return NULL;
|
||||
#endif
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue