@@ -1504,12 +1504,20 @@ os
1504
1504
:func: `~os.link `, :func: `~os.lstat `, :func: `~os.mkdir `, :func: `~os.mkfifo `,
1505
1505
:func: `~os.mknod `, :func: `~os.open `, :func: `~os.readlink `, :func: `~os.remove `,
1506
1506
: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 `.
1508
1510
1509
1511
- The following functions now support a file descriptor for their path argument:
1510
1512
:func: `~os.chdir `, :func: `~os.chmod `, :func: `~os.chown `,
1511
1513
: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.
1513
1521
1514
1522
* The :mod: `os ` module has two new functions: :func: `~os.getpriority ` and
1515
1523
:func: `~os.setpriority `. They can be used to get or set process
1558
1566
for a file.
1559
1567
* :func: `~os.sync `: Force write of everything to disk.
1560
1568
1561
- * Add some extra posix functions to the os module :
1569
+ * Additional new posix functions:
1562
1570
1563
1571
* :func: `~os.lockf `: Apply, test or remove a POSIX lock on an open file descriptor.
1564
1572
* :func: `~os.pread `: Read from a file descriptor at an offset, the file
@@ -1577,6 +1585,12 @@ os
1577
1585
* :func: `~os.times ` and :func: `~os.uname `: Return type changed from a tuple to
1578
1586
a tuple-like object with named attributes.
1579
1587
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
+
1580
1594
1581
1595
pdb
1582
1596
---
@@ -1703,6 +1717,14 @@ signal
1703
1717
instead of a RuntimeError: OSError has an errno attribute.
1704
1718
1705
1719
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
+
1706
1728
smtpd
1707
1729
-----
1708
1730
@@ -1810,6 +1832,18 @@ the form '-rwxrwxrwx'.
1810
1832
1811
1833
(Contributed by Giampaolo Rodolà in :issue: `14807 `)
1812
1834
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
+
1813
1847
sys
1814
1848
---
1815
1849
@@ -1872,10 +1906,11 @@ unittest
1872
1906
1873
1907
:meth: `.assertRaises `, :meth: `.assertRaisesRegex `, :meth: `.assertWarns `, and
1874
1908
: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 `)
1878
1911
1912
+ :meth: `unittest.TestCase.run ` now returns the :class: `~unittest.TestResult `
1913
+ object.
1879
1914
1880
1915
urllib
1881
1916
------
@@ -1993,7 +2028,7 @@ Deprecated Python modules, functions and methods
1993
2028
* :meth: `ftplib.FTP.nlst ` and :meth: `ftplib.FTP.dir `: use
1994
2029
:meth: `ftplib.FTP.mlsd `
1995
2030
* :func: `platform.popen `: use the :mod: `subprocess ` module. Check especially
1996
- the :ref: `subprocess-replacements ` section.
2031
+ the :ref: `subprocess-replacements ` section ( :issue: ` 11377 `) .
1997
2032
* :issue: `13374 `: The Windows bytes API has been deprecated in the :mod: `os `
1998
2033
module. Use Unicode filenames, instead of bytes filenames, to not depend on
1999
2034
the ANSI code page anymore and to support any filename.
0 commit comments