[Python-checkins] cpython (merge 3.3 -> default): Merge: More whatsnew adds, especially the os module.

r.david.murray python-checkins at python.org
Mon Oct 1 02:09:55 CEST 2012


http://hg.python.org/cpython/rev/cc79da8c8970
changeset:   79352:cc79da8c8970
parent:      79350:abb5c5bde872
parent:      79351:5242ccd0a3f6
user:        R David Murray <rdmurray at bitdance.com>
date:        Sun Sep 30 20:09:04 2012 -0400
summary:
  Merge: More whatsnew adds, especially the os module.

I went through all the versionchanged/versionadded tags in the os doc page for
this changeset.

files:
  Doc/whatsnew/3.3.rst |  51 ++++++++++++++++++++++++++-----
  Misc/NEWS            |   4 +-
  2 files changed, 45 insertions(+), 10 deletions(-)


diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst
--- a/Doc/whatsnew/3.3.rst
+++ b/Doc/whatsnew/3.3.rst
@@ -1504,12 +1504,20 @@
     :func:`~os.link`, :func:`~os.lstat`, :func:`~os.mkdir`, :func:`~os.mkfifo`,
     :func:`~os.mknod`, :func:`~os.open`, :func:`~os.readlink`, :func:`~os.remove`,
     :func:`~os.rename`, :func:`~os.replace`, :func:`~os.rmdir`, :func:`~os.stat`,
-    :func:`~os.symlink`, :func:`~os.unlink`, :func:`~os.utime`.
+    :func:`~os.symlink`, :func:`~os.unlink`, :func:`~os.utime`.  Platform
+    support for using these parameters can be checked via the sets
+    :data:`os.supports_dir_fd` and :data:`os.supports_follows_symlinks`.
 
   - The following functions now support a file descriptor for their path argument:
     :func:`~os.chdir`, :func:`~os.chmod`, :func:`~os.chown`,
     :func:`~os.execve`, :func:`~os.listdir`, :func:`~os.pathconf`, :func:`~os.path.exists`,
-    :func:`~os.stat`, :func:`~os.statvfs`, :func:`~os.utime`.
+    :func:`~os.stat`, :func:`~os.statvfs`, :func:`~os.utime`.  Platform support
+    for this can be checked via the :data:`os.supports_fd` set.
+
+* :func:`~os.access` accepts an ``effective_ids`` keyword argument to turn on
+  using the effective uid/gid rather than the real uid/gid in the access check.
+  Platform support for this can be checked via the
+  :data:`~os.supports_effective_ids` set.
 
 * The :mod:`os` module has two new functions: :func:`~os.getpriority` and
   :func:`~os.setpriority`. They can be used to get or set process
@@ -1558,7 +1566,7 @@
     for a file.
   * :func:`~os.sync`: Force write of everything to disk.
 
-* Add some extra posix functions to the os module:
+* Additional new  posix functions:
 
   * :func:`~os.lockf`: Apply, test or remove a POSIX lock on an open file descriptor.
   * :func:`~os.pread`: Read from a file descriptor at an offset, the file
@@ -1577,6 +1585,12 @@
 * :func:`~os.times` and :func:`~os.uname`: Return type changed from a tuple to
   a tuple-like object with named attributes.
 
+* Some platforms now support additional constants for the :func:`~os.lseek`
+  function, such as ``os.SEEK_HOLE`` and ``os.SEEK_DATA``.
+
+* :func:`os.symlink` now accepts (and ignores) the ``target_is_directory``
+  keyword argument on non-Windows platforms, to ease cross-platform support.
+
 
 pdb
 ---
@@ -1703,6 +1717,14 @@
   instead of a RuntimeError: OSError has an errno attribute.
 
 
+smtp
+----
+
+:class:`~smtplib.SMTP` now supports the context manager protocol, allowing an
+``SMTP`` instance to be used in a ``with`` statement.  (Contributed
+by Giampaolo Rodolà in :issue:`11289`.)
+
+
 smtpd
 -----
 
@@ -1810,6 +1832,18 @@
 
 (Contributed by Giampaolo Rodolà in :issue:`14807`)
 
+
+subprocess
+----------
+
+Command strings can now be bytes objects on posix platforms.  (Contributed by
+Victor Stiner in :issue:`8513`.)
+
+A new constant :data:`~subprocess.DEVNULL` allows suppressing output in a
+platform-independent fashion.  (Contributed by Ross Lagerwall in
+:issue:`5870`.)
+
+
 sys
 ---
 
@@ -1872,10 +1906,11 @@
 
 :meth:`.assertRaises`, :meth:`.assertRaisesRegex`, :meth:`.assertWarns`, and
 :meth:`.assertWarnsRegex` now accept a keyword argument *msg* when used as
-context managers.
-
-(Contributed by Ezio Melotti and Winston Ewert in :issue:`10775`)
-
+context managers.  (Contributed by Ezio Melotti and Winston Ewert in
+:issue:`10775`)
+
+:meth:`unittest.TestCase.run` now returns the :class:`~unittest.TestResult`
+object.
 
 urllib
 ------
@@ -1993,7 +2028,7 @@
 * :meth:`ftplib.FTP.nlst` and :meth:`ftplib.FTP.dir`: use
   :meth:`ftplib.FTP.mlsd`
 * :func:`platform.popen`: use the :mod:`subprocess` module. Check especially
-  the :ref:`subprocess-replacements` section.
+  the :ref:`subprocess-replacements` section (:issue:`11377`).
 * :issue:`13374`: The Windows bytes API has been deprecated in the :mod:`os`
   module. Use Unicode filenames, instead of bytes filenames, to not depend on
   the ANSI code page anymore and to support any filename.
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -3700,7 +3700,7 @@
   not installed. Instead, the zipfile.ZIP_STORED compression is used to create
   the ZipFile. Patch by Natalia B. Bidart.
 
-- Issue #11289: `smtp.SMTP` class becomes a context manager so it can be used
+- Issue #11289: `smtp.SMTP` class is now a context manager so it can be used
   in a `with` statement.  Contributed by Giampaolo Rodola.
 
 - Issue #11554: Fixed support for Japanese codecs; previously the body output
@@ -3712,7 +3712,7 @@
 - Issue #11407: `TestCase.run` returns the result object used or created.
   Contributed by Janathan Hartley.
 
-- Issue #11500: Fixed a bug in the os x proxy bypass code for fully qualified
+- Issue #11500: Fixed a bug in the OS X proxy bypass code for fully qualified
   IP addresses in the proxy exception list.
 
 - Issue #11491: dbm.error is no longer raised when dbm.open is called with

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list