Skip to content

Commit c652ce6

Browse files
committed
More whatsnew adds, especially the os module.
I went through all the versionchanged/versionadded tags in the os doc page for this changeset.
1 parent b7a0bfe commit c652ce6

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

Doc/whatsnew/3.3.rst

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,12 +1504,20 @@ os
15041504
:func:`~os.link`, :func:`~os.lstat`, :func:`~os.mkdir`, :func:`~os.mkfifo`,
15051505
:func:`~os.mknod`, :func:`~os.open`, :func:`~os.readlink`, :func:`~os.remove`,
15061506
:func:`~os.rename`, :func:`~os.replace`, :func:`~os.rmdir`, :func:`~os.stat`,
1507-
:func:`~os.symlink`, :func:`~os.unlink`, :func:`~os.utime`.
1507+
:func:`~os.symlink`, :func:`~os.unlink`, :func:`~os.utime`. Platform
1508+
support for using these parameters can be checked via the sets
1509+
:data:`os.supports_dir_fd` and :data:`os.supports_follows_symlinks`.
15081510

15091511
- The following functions now support a file descriptor for their path argument:
15101512
:func:`~os.chdir`, :func:`~os.chmod`, :func:`~os.chown`,
15111513
:func:`~os.execve`, :func:`~os.listdir`, :func:`~os.pathconf`, :func:`~os.path.exists`,
1512-
:func:`~os.stat`, :func:`~os.statvfs`, :func:`~os.utime`.
1514+
:func:`~os.stat`, :func:`~os.statvfs`, :func:`~os.utime`. Platform support
1515+
for this can be checked via the :data:`os.supports_fd` set.
1516+
1517+
* :func:`~os.access` accepts an ``effective_ids`` keyword argument to turn on
1518+
using the effective uid/gid rather than the real uid/gid in the access check.
1519+
Platform support for this can be checked via the
1520+
:data:`~os.supports_effective_ids` set.
15131521

15141522
* The :mod:`os` module has two new functions: :func:`~os.getpriority` and
15151523
:func:`~os.setpriority`. They can be used to get or set process
@@ -1558,7 +1566,7 @@ os
15581566
for a file.
15591567
* :func:`~os.sync`: Force write of everything to disk.
15601568

1561-
* Add some extra posix functions to the os module:
1569+
* Additional new posix functions:
15621570

15631571
* :func:`~os.lockf`: Apply, test or remove a POSIX lock on an open file descriptor.
15641572
* :func:`~os.pread`: Read from a file descriptor at an offset, the file
@@ -1577,6 +1585,12 @@ os
15771585
* :func:`~os.times` and :func:`~os.uname`: Return type changed from a tuple to
15781586
a tuple-like object with named attributes.
15791587

1588+
* Some platforms now support additional constants for the :func:`~os.lseek`
1589+
function, such as ``os.SEEK_HOLE`` and ``os.SEEK_DATA``.
1590+
1591+
* :func:`os.symlink` now accepts (and ignores) the ``target_is_directory``
1592+
keyword argument on non-Windows platforms, to ease cross-platform support.
1593+
15801594

15811595
pdb
15821596
---
@@ -1703,6 +1717,14 @@ signal
17031717
instead of a RuntimeError: OSError has an errno attribute.
17041718

17051719

1720+
smtp
1721+
----
1722+
1723+
:class:`~smtplib.SMTP` now supports the context manager protocol, allowing an
1724+
``SMTP`` instance to be used in a ``with`` statement. (Contributed
1725+
by Giampaolo Rodolà in :issue:`11289`.)
1726+
1727+
17061728
smtpd
17071729
-----
17081730

@@ -1810,6 +1832,18 @@ the form '-rwxrwxrwx'.
18101832

18111833
(Contributed by Giampaolo Rodolà in :issue:`14807`)
18121834

1835+
1836+
subprocess
1837+
----------
1838+
1839+
Command strings can now be bytes objects on posix platforms. (Contributed by
1840+
Victor Stiner in :issue:`8513`.)
1841+
1842+
A new constant :data:`~subprocess.DEVNULL` allows suppressing output in a
1843+
platform-independent fashion. (Contributed by Ross Lagerwall in
1844+
:issue:`5870`.)
1845+
1846+
18131847
sys
18141848
---
18151849

@@ -1872,10 +1906,11 @@ unittest
18721906

18731907
:meth:`.assertRaises`, :meth:`.assertRaisesRegex`, :meth:`.assertWarns`, and
18741908
:meth:`.assertWarnsRegex` now accept a keyword argument *msg* when used as
1875-
context managers.
1876-
1877-
(Contributed by Ezio Melotti and Winston Ewert in :issue:`10775`)
1909+
context managers. (Contributed by Ezio Melotti and Winston Ewert in
1910+
:issue:`10775`)
18781911

1912+
:meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult`
1913+
object.
18791914

18801915
urllib
18811916
------
@@ -1993,7 +2028,7 @@ Deprecated Python modules, functions and methods
19932028
* :meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP.dir`: use
19942029
:meth:`ftplib.FTP.mlsd`
19952030
* :func:`platform.popen`: use the :mod:`subprocess` module. Check especially
1996-
the :ref:`subprocess-replacements` section.
2031+
the :ref:`subprocess-replacements` section (:issue:`11377`).
19972032
* :issue:`13374`: The Windows bytes API has been deprecated in the :mod:`os`
19982033
module. Use Unicode filenames, instead of bytes filenames, to not depend on
19992034
the ANSI code page anymore and to support any filename.

Misc/NEWS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3690,7 +3690,7 @@ Library
36903690
not installed. Instead, the zipfile.ZIP_STORED compression is used to create
36913691
the ZipFile. Patch by Natalia B. Bidart.
36923692

3693-
- Issue #11289: `smtp.SMTP` class becomes a context manager so it can be used
3693+
- Issue #11289: `smtp.SMTP` class is now a context manager so it can be used
36943694
in a `with` statement. Contributed by Giampaolo Rodola.
36953695

36963696
- Issue #11554: Fixed support for Japanese codecs; previously the body output
@@ -3702,7 +3702,7 @@ Library
37023702
- Issue #11407: `TestCase.run` returns the result object used or created.
37033703
Contributed by Janathan Hartley.
37043704

3705-
- Issue #11500: Fixed a bug in the os x proxy bypass code for fully qualified
3705+
- Issue #11500: Fixed a bug in the OS X proxy bypass code for fully qualified
37063706
IP addresses in the proxy exception list.
37073707

37083708
- Issue #11491: dbm.error is no longer raised when dbm.open is called with

0 commit comments

Comments
 (0)