diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-10-01 00:07:42 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-10-01 00:07:42 (GMT) |
commit | c652ce6d02d3665465ec87fbc1aae98558b07e43 (patch) | |
tree | eb6f8194832131cf007e10421d453486b22c1fe1 /Doc/whatsnew | |
parent | b7a0bfe912f203468e67f0541a365a4cc41a7cb2 (diff) | |
download | cpython-c652ce6d02d3665465ec87fbc1aae98558b07e43.zip cpython-c652ce6d02d3665465ec87fbc1aae98558b07e43.tar.gz cpython-c652ce6d02d3665465ec87fbc1aae98558b07e43.tar.bz2 |
More whatsnew adds, especially the os module.
I went through all the versionchanged/versionadded tags in the os doc page for
this changeset.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.3.rst | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index 41a0c36..e1e0fe6 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -1504,12 +1504,20 @@ os :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 @@ os 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 @@ os * :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 @@ signal 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 @@ the form '-rwxrwxrwx'. (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 @@ unittest :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 @@ Deprecated Python modules, functions and methods * :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. |