summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"Larry Hastings2012-06-231-4/+1
| | | | | | | parameter from os.remove / os.unlink. Patch written by Georg Brandl. (I'm really looking forward to George getting commit privileges so I don't have to keep doing checkins on his behalf.)
* Issue #14626: Fix buildbot issue on OpenIndiana 3.x machines. (Hopefully.)Larry Hastings2012-06-231-10/+21
|
* Issue #14626: Large refactoring of functions / parameters in the os module.Larry Hastings2012-06-221-13/+104
| | | | | | | | | Many functions now support "dir_fd" and "follow_symlinks" parameters; some also support accepting an open file descriptor in place of of a path string. Added os.support_* collections as LBYL helpers. Removed many functions only previously seen in 3.3 alpha releases (often starting with "f" or "l", or ending with "at"). Originally suggested by Serhiy Storchaka; implemented by Larry Hastings.
* Closes #10142: Support for SEEK_HOLE/SEEK_DATAJesus Cea2012-06-221-0/+1
|
* Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSErrorGregory P. Smith2012-06-031-2/+14
|\ | | | | | | | | | | when the path existed and had the S_ISGID mode bit set when it was not explicitly asked for. This is no longer an exception as mkdir cannot control if the OS sets that bit for it or not.
| * Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSErrorGregory P. Smith2012-06-031-2/+14
| | | | | | | | | | | | when the path existed and had the S_ISGID mode bit set when it was not explicitly asked for. This is no longer an exception as mkdir cannot control if the OS sets that bit for it or not.
* | #14862: Add missing names to os.__all__Petri Lehtinen2012-05-231-2/+9
| |
* | #14773: Fix os.fwalk() failing on dangling symlinksHynek Schlawack2012-05-151-7/+17
| |
* | use yield fromBenjamin Peterson2012-05-101-6/+3
| |
* | Backing out 86dc014cdd74. Not ready yetJesus Cea2012-04-261-1/+0
| |
* | Close #10142: Support for SEEK_HOLE/SEEK_DATAJesus Cea2012-04-261-0/+1
| |
* | Use os.path.samestat() instead of reinventing the wheel.Charles-François Natali2012-04-221-9/+2
| |
* | Issue #2377: Make importlib the implementation of __import__().Brett Cannon2012-04-141-0/+2
| | | | | | | | | | | | | | importlib._bootstrap is now frozen into Python/importlib.h and stored as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen code along with sys and imp and then uses _frozen_importlib._install() to set builtins.__import__() w/ _frozen_importlib.__import__().
* | Merge 3.2: Issue #13703 plus some related test suite fixes.Georg Brandl2012-02-201-17/+0
|\ \ | |/
| * Merge from 3.1: Issue #13703: add a way to randomize the hash values of ↵Georg Brandl2012-02-201-17/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | basic types (str, bytes, datetime) in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated. The environment variable PYTHONHASHSEED and the new command line flag -R control this behavior.
| | * Issue #13703: add a way to randomize the hash values of basic types (str, ↵Georg Brandl2012-02-201-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | bytes, datetime) in order to make algorithmic complexity attacks on (e.g.) web apps much more complicated. The environment variable PYTHONHASHSEED and the new command line flag -R control this behavior.
* | | Following Nick's suggestion, rename posix.fdlistdir() to posix.flistdir(), toCharles-François Natali2012-02-061-1/+1
| | | | | | | | | | | | | | | be consistent with other functions accepting file descriptors (fdlistdir() was added in 3.3, so hasn't been released yet).
* | | Issue #13734: Add os.fwalk(), a directory walking function yielding fileCharles-François Natali2012-02-051-5/+96
| | | | | | | | | | | | descriptors.
* | | Issue #11459: A `bufsize` value of 0 in subprocess.Popen() really createsAntoine Pitrou2011-03-191-1/+3
|\ \ \ | |/ / | | | | | | unbuffered pipes, such that select() works properly on them.
| * | Issue #11459: A `bufsize` value of 0 in subprocess.Popen() really createsAntoine Pitrou2011-03-191-1/+3
| |\ \ | | |/ | | | | | | unbuffered pipes, such that select() works properly on them.
| | * Issue #11459: A `bufsize` value of 0 in subprocess.Popen() really createsAntoine Pitrou2011-03-191-1/+3
| | | | | | | | | | | | unbuffered pipes, such that select() works properly on them.
| | * Merged revisions 80421,80424 via svnmerge fromVictor Stinner2010-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r80421 | victor.stinner | 2010-04-23 23:41:56 +0200 (ven., 23 avril 2010) | 3 lines Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates and bytes strings for environment keys and values ........ r80424 | victor.stinner | 2010-04-24 00:55:39 +0200 (sam., 24 avril 2010) | 13 lines Fix test_undecodable_env of test_subproces for non-ASCII directory This test was introduced by r80421 (issue #8391). The fix: copy the environment variables instead of starting Python in an empty environement. In an empty environment, the locale is C and Python uses ASCII for the default file system encoding. The non-ASCII directory will be encoded using surrogates, but Python3 is unable to load a module or package with a filename using surrogates. See issue #8242 for more information about running Python3 with a non-ascii directory in an empty environement. ........
| | * Merged revisions 78316 via svnmerge fromEzio Melotti2010-02-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r78316 | ezio.melotti | 2010-02-22 17:59:01 +0200 (Mon, 22 Feb 2010) | 1 line #7310: fix the repr() of os.environ ........
| | * Merged revisions 77881 via svnmerge fromMatthias Klose2010-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77881 | matthias.klose | 2010-01-31 17:48:44 +0100 (So, 31 Jan 2010) | 9 lines Merged revisions 77879 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77879 | matthias.klose | 2010-01-31 17:46:26 +0100 (So, 31 Jan 2010) | 2 lines - Fix typo in os.execvp docstring. ........ ................
| | * Merged revisions 76723 via svnmerge fromAntoine Pitrou2009-12-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r76723 | antoine.pitrou | 2009-12-09 01:01:27 +0100 (mer., 09 déc. 2009) | 3 lines Issue #7461: objects returned by os.popen() should support the context manager protocol ........
| | * Merged revisions 73934 via svnmerge fromAmaury Forgeot d'Arc2009-07-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r73934 | amaury.forgeotdarc | 2009-07-11 11:35:13 +0200 (sam., 11 juil. 2009) | 3 lines #6358: Merge r73933: Add basic tests for the return value of os.popen().close(). And fix the implementation to make these tests pass with py3k ........
* | | Issue #11085: Moved collections abstract base classes into a separate moduleRaymond Hettinger2011-02-221-1/+1
|/ / | | | | | | | | | | called collections.abc, following the pattern used by importlib.abc. For backwards compatibility, the names continue to also be imported into the collections module.
* | Issue 9299 Add exist_ok parameter to os.makedirs to suppress 'File exists' ↵Terry Reedy2010-12-021-6/+20
| | | | | | | | exception. Patch by Ray Allen.
* | os module: remove nonbreaking space in a commentVictor Stinner2010-11-071-2/+2
| |
* | os.get_exec_path() ignores BytesWarning instead of recoding themVictor Stinner2010-11-061-28/+24
| | | | | | | | | | Use only one global warning.catch_warnings() context, instead of two local contexts. Improve also the explaination why the function uses a local import.
* | Issue #10210: os.get_exec_path() ignores BytesWarning warningsVictor Stinner2010-10-291-2/+16
| |
* | str.encode() doesn't accept None as errors: use 'strict' insteadVictor Stinner2010-10-241-1/+1
| |
* | os: fsencode(), fsdecode() and os.environ(b) internal encode-decode methodsVictor Stinner2010-10-241-32/+37
| | | | | | | | | | | | | | keep a local copy of the fileystem encoding, instead of calling sys.getfilesystemencoding() each time. The filesystem encoding is now constant.
* | Issue #8603: Environ.data is now protected -> Environ._dataVictor Stinner2010-09-101-8/+8
| | | | | | | | | | os.environ.data was a str dict in Python 3.1. In Python 3.2 on UNIX/BSD, os.environ.data is now a bytes dict: mark it as protected to avoid confusion.
* | Fix os.get_exec_path() (code and tests) for python -bbVictor Stinner2010-08-191-2/+2
| | | | | | | | Catch BytesWarning exceptions.
* | Create os.fsdecode(): decode from the filesystem encoding with surrogateescapeVictor Stinner2010-08-191-11/+30
| | | | | | | | | | | | | | | | error handler, or strict error handler on Windows. * Rewrite os.fsencode() documentation * Improve os.fsencode and os.fsdecode() tests using the new PYTHONFSENCODING environment variable
* | #8603: Add environb to os.__all__Victor Stinner2010-07-291-1/+2
| |
* | Issue #9283: Oops, add missing { and } to repr(os.environ)Victor Stinner2010-07-281-1/+1
| |
* | #9283: Fix repr(os.environ), display unicode keys and values on POSIX systemsVictor Stinner2010-07-281-1/+3
| |
* | Issue #8969: On Windows, use mbcs codec in strict mode to encode and decodeVictor Stinner2010-06-111-9/+12
| | | | | | | | filenames and enable os.fsencode().
* | Issue #8513: os.get_exec_path() supports b'PATH' key and bytes value.Victor Stinner2010-05-181-4/+33
| | | | | | | | | | | | subprocess.Popen() and os._execvpe() support bytes program name. Add os.supports_bytes_environ flag: True if the native OS type of the environment is bytes (eg. False on Windows).
* | Issue #8514: Add os.fsencode() function (Unix only): encode a string to bytesVictor Stinner2010-05-081-0/+11
| | | | | | | | for use in the file system, environment variables or the command line.
* | Issue #8603: Create a bytes version of os.environ for UnixVictor Stinner2010-05-061-19/+68
| | | | | | | | | | | | | | Create os.environb mapping and os.getenvb() function, os.unsetenv() encodes str argument to the file system encoding with the surrogateescape error handler (instead of utf8/strict) and accepts bytes, and posix.environ keys and values are bytes.
* | Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates andVictor Stinner2010-04-231-0/+2
| | | | | | | | bytes strings for environment keys and values
* | Add an os.get_exec_path() function to return the list of directoriesGregory P. Smith2010-02-271-10/+17
| | | | | | | | | | that launching a subprocess will search for the executable. Refactors some code in os._execvpe().
* | #7310: fix the repr() of os.environEzio Melotti2010-02-221-0/+10
| |
* | Merged revisions 77879 via svnmerge fromMatthias Klose2010-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77879 | matthias.klose | 2010-01-31 17:46:26 +0100 (So, 31 Jan 2010) | 2 lines - Fix typo in os.execvp docstring. ........
* | Issue #7461: objects returned by os.popen() should support the context ↵Antoine Pitrou2009-12-091-0/+4
| | | | | | | | manager protocol
* | Merged revisions ↵Benjamin Peterson2009-11-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 75264,75268,75293,75318,75391-75392,75436,75478,75971,76003,76058,76140-76141,76231,76380,76428-76429 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75264 | andrew.kuchling | 2009-10-05 17:30:22 -0500 (Mon, 05 Oct 2009) | 1 line Add various items ........ r75268 | andrew.kuchling | 2009-10-05 17:45:39 -0500 (Mon, 05 Oct 2009) | 1 line Remove two notes ........ r75293 | kristjan.jonsson | 2009-10-09 09:32:19 -0500 (Fri, 09 Oct 2009) | 2 lines http://bugs.python.org/issue7029 a non-default timer wasn't actually used by the individual Tests. ........ r75318 | benjamin.peterson | 2009-10-10 16:15:58 -0500 (Sat, 10 Oct 2009) | 1 line remove script which uses long gone module ........ r75391 | andrew.kuchling | 2009-10-13 10:49:33 -0500 (Tue, 13 Oct 2009) | 1 line Link to PEP ........ r75392 | andrew.kuchling | 2009-10-13 11:11:49 -0500 (Tue, 13 Oct 2009) | 1 line Various link, textual, and markup fixes ........ r75436 | benjamin.peterson | 2009-10-15 10:39:15 -0500 (Thu, 15 Oct 2009) | 1 line don't need to mess up sys.path ........ r75478 | senthil.kumaran | 2009-10-17 20:58:45 -0500 (Sat, 17 Oct 2009) | 3 lines Fix a typo. ........ r75971 | benjamin.peterson | 2009-10-30 22:56:15 -0500 (Fri, 30 Oct 2009) | 1 line add some checks for evaluation order with parenthesis #7210 ........ r76003 | antoine.pitrou | 2009-10-31 19:30:13 -0500 (Sat, 31 Oct 2009) | 6 lines Hopefully fix the buildbot problems on test_mailbox, by computing the maildir toc cache refresh date before actually refreshing the cache. (see #6896) ........ r76058 | benjamin.peterson | 2009-11-02 10:14:19 -0600 (Mon, 02 Nov 2009) | 1 line grant list.index() a more informative error message #7252 ........ r76140 | nick.coghlan | 2009-11-07 02:13:55 -0600 (Sat, 07 Nov 2009) | 1 line Add test for runpy.run_module package execution and use something other than logging as the example of a non-executable package ........ r76141 | nick.coghlan | 2009-11-07 02:15:01 -0600 (Sat, 07 Nov 2009) | 1 line Some minor cleanups to private runpy code and docstrings ........ r76231 | benjamin.peterson | 2009-11-12 17:42:23 -0600 (Thu, 12 Nov 2009) | 1 line this main is much more useful ........ r76380 | antoine.pitrou | 2009-11-18 14:20:46 -0600 (Wed, 18 Nov 2009) | 3 lines Mention Giampolo R's new FTP TLS support in the what's new file ........ r76428 | benjamin.peterson | 2009-11-19 20:15:50 -0600 (Thu, 19 Nov 2009) | 1 line turn goto into do while loop ........ r76429 | benjamin.peterson | 2009-11-19 20:56:43 -0600 (Thu, 19 Nov 2009) | 2 lines avoid doing an uneeded import in a function ........
* | #6358: Merge r73933: Add basic tests for the return value of os.popen().close().Amaury Forgeot d'Arc2009-07-111-1/+7
|/ | | | And fix the implementation to make these tests pass with py3k