Commit Graph

107 Commits

Author SHA1 Message Date
Philip Jenvey 7865296ca3 Merged revisions 75143 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75143 | philip.jenvey | 2009-09-29 12:10:15 -0700 (Tue, 29 Sep 2009) | 5 lines

  #5329: fix os.popen* regression from 2.5: don't execute commands as a sequence
  through the shell. also document the correct subprocess replacement for this
  case
  patch from Jean-Paul Calderone and Jani Hakala
........
2009-09-29 19:18:11 +00:00
Gregory P. Smith d712203d17 Issue #3708: os.urandom no longer goes into an infinite loop when passed a
non-integer floating point number.
2008-09-02 05:36:11 +00:00
Brett Cannon 88f801d409 Update __all__ for cookielib, csv, os, and urllib2 for objects imported into
the module but exposed as part of the API.
2008-08-18 00:46:22 +00:00
Georg Brandl dffbf5f542 Revert copy_reg -> copyreg rename. 2008-05-20 07:49:57 +00:00
Ronald Oussoren 81af68ee61 Remove references to platform 'mac'
The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port,
which is no longer supported (as of Python 2.4 IIRC).
2008-05-12 11:24:33 +00:00
Alexandre Vassalotti 9510e4a9f8 Added module stub for copy_reg renaming in 3.0.
Renamed copy_reg to copyreg in the standard library, to avoid
spurious warnings and ease later merging to py3k branch. Public
documentation remains intact.
2008-05-11 08:25:28 +00:00
Gregory P. Smith 8e4997390c fix issue2707 - os.walk docstring example correctness typo. 2008-05-06 07:05:18 +00:00
Facundo Batista 2ffd780858 Moved the errno import from inside the functions to the
module level.  Fixes issue 1755179.
2007-11-27 18:50:12 +00:00
Georg Brandl dd1a8466f5 Fix new pop() method on os.environ on ignorecase-platforms. 2007-10-26 18:30:41 +00:00
Georg Brandl 1a94ec2664 Bug #1287: make os.environ.pop() work as expected. 2007-10-24 21:40:38 +00:00
Georg Brandl 4a21268a74 Patch #1181: add os.environ.clear() method. 2007-09-20 17:57:59 +00:00
Neal Norwitz 42dd86b8e2 Deprecate os.popen* and popen2 module in favor of the subprocess module. 2007-05-11 06:57:33 +00:00
Georg Brandl cae9f3d916 New test for rev. 54407 which only uses directories under TESTFN. 2007-03-21 09:10:29 +00:00
Neal Norwitz c990f6454f Try backing out 54407 to see if it corrects the problems on the Windows
buildbots.  This rev was backported, so we will need to keep both branches
in sync, pending the outcome of the test after this checkin.
2007-03-20 05:23:09 +00:00
Georg Brandl 8844e438b1 Patch #1273829: os.walk() now has a "followlinks" parameter. If set to
True (which is not the default), it visits symlinks pointing to
directories.
2007-03-16 08:22:40 +00:00
Georg Brandl f54a63b3b5 Move errno imports back to individual functions. 2006-12-11 07:56:33 +00:00
Georg Brandl b130743e97 Patch #1608267: fix a race condition in os.makedirs() is the directory
to be created is already there.
2006-12-09 09:08:29 +00:00
Georg Brandl 07fec3aa5a os.urandom no longer masks unrelated exceptions like SystemExit or
KeyboardInterrupt.
2006-08-01 18:49:24 +00:00
Georg Brandl bde4ad4f92 Patch #1410998: remove "DOS" from os.py docstring 2006-01-20 21:36:02 +00:00
Fredrik Lundh 96c1c7a571 SF#1343671.
The removedirs function removes empty directories, it doesn't
empty them.
2005-11-12 15:55:04 +00:00
Georg Brandl 9e43acf2f3 bug #1177468: don't cache /dev/urandom file descriptor in os.urandom 2005-07-04 17:16:07 +00:00
Martin v. Löwis 5510f65f5a Avoid using items() in environ.update(). Fixes #1124513.
Will backport to 2.4.
2005-02-17 21:23:20 +00:00
Martin v. Löwis 1d11de6dbd Revert os.py 1.75, and directly implement update.
Fixes #1110478 and #1100235.
2005-01-29 13:29:23 +00:00
Martin v. Löwis 22b457e03b Added SEEK_* constants. Fixes #711830. 2005-01-16 08:40:58 +00:00
Johannes Gijsbers 9fc9789a0d Document that on Unix, the 'cmd' argument to the os.popen2/3/4 and
popen2.popen2/3/4 functions can be a sequence. All texts are a variation on the
following:

On \UNIX, \var{cmd} may be a sequence, in which case arguments will be passed
directly to the program without shell intervention (as with
\function{os.spawnv()}). If \var{cmd} is a string it will be passed to the shell
(as with \function{os.system()}).
2004-10-11 18:12:20 +00:00
Martin v. Löwis 725f8c83a2 Patch #1021596: Check for None to determine whether _urandomfd is
uninitialized.
2004-09-18 16:07:58 +00:00
Tim Peters 3b2cdad4fd Whitespace normalization. 2004-09-01 13:10:32 +00:00
Andrew M. Kuchling 33ad28b68d Use multi-line import 2004-08-31 11:38:12 +00:00
Tim Peters 45e77c55ff Whitespace normalization. 2004-08-29 18:47:31 +00:00
Martin v. Löwis dc3883f671 Patch #934711: Expose platform-specific entropy. 2004-08-29 15:46:35 +00:00
Martin v. Löwis bdec50f027 Feature request #935915: Add os.path.devnull. 2004-06-08 08:29:33 +00:00
Andrew MacIntyre 69e18c9344 OS/2 has support for spawnvp() and spawnvpe() in the C libraries supplied
with major C compilers (VACPP, EMX+gcc and [Open]Watcom).

Also tidy up the export of spawn*() symbols in the os module to match what
is found/implemented.
2004-04-04 07:11:43 +00:00
Raymond Hettinger 31017aed36 SF #904720: dict.update should take a 2-tuple sequence like dict.__init_
(Championed by Bob Ippolito.)

The update() method for mappings now accepts all the same argument forms
as the dict() constructor.  This includes item lists and/or keyword
arguments.
2004-03-04 08:25:44 +00:00
Andrew M. Kuchling 6fccc8a9ec [Bug #829532] Invoking os.makedirs() with an argument that contains a
directory name with a single dot fails.  The patch skips creating
    directories named os.curdir. (Patch by Bram Moolenaar)

2.3 bugfix candidate.
2003-12-23 16:33:28 +00:00
Andrew MacIntyre 89f9865b91 OS/2+EMX: make the link() emulation available as os.link() 2003-12-02 12:33:01 +00:00
Neal Norwitz b7f6810a1f SF #764121, docstring for spawnlp incorrect 2003-07-02 02:49:33 +00:00
Guido van Rossum bf1bef820c Add optional 'onerror' argument to os.walk(), to control error
handling.
2003-05-13 18:01:19 +00:00
Tim Peters c4e0940042 New generator os.walk() does a bit more than os.path.walk() does, and
seems much easier to use.  Code, docs, NEWS, and additions to test_os.py
(testing this sucker is a bitch!).
2003-04-25 07:11:48 +00:00
Guido van Rossum 68468eba63 Get rid of many apply() calls. 2003-02-27 20:14:51 +00:00
Tim Peters f2715e0764 Whitespace normalization. 2003-02-19 02:35:07 +00:00
Skip Montanaro 117910dc44 Migrate definitions of several platform-dependent path-related variables
into the relevant path modules.  See patch #686397.
2003-02-14 19:35:31 +00:00
Tim Peters 2c60f7a136 Whitespace normalization. 2003-01-29 03:49:43 +00:00
Tim Peters 6757c1e856 SF patch 661583: Remove old code from lib\os.py
A patch from Andrew Wilkinson to change some bizarre old exec statements
specific to NT and CE.
2003-01-08 21:20:57 +00:00
Jack Jansen b11ce9b96c Always define getenv(), as suggested by Guido. This means that os.getenv() is also defined for MacPython-OS9 (even though it doesn't actually do anything useful), and it shouldn't hurt on other platforms. 2003-01-08 16:33:40 +00:00
Martin v. Löwis 8b10f8988f Remove more DOS support. 2002-10-09 17:23:29 +00:00
Raymond Hettinger 05212fc7f3 Change UserDict to IterableUserDict 2002-09-07 04:48:03 +00:00
Raymond Hettinger ca2f537e32 Have os.environ() inherit from the iterable version of UserDict.
Closes SF bug 605731.
2002-09-06 19:36:31 +00:00
Guido van Rossum 683c0fe414 Fix for SF bug 601077 by Zack Weinberg.
The new execvpe code would sometimes do the wrong thing when a
non-executable file existed earlier in the path and an executable file
of the same name existed later in the path.  This patch restores the
proper behavior (which is to execute the second file).  When only a
non-executable file exists, the correct error is still reported.
2002-09-03 16:36:17 +00:00
Guido van Rossum aed51d8121 SF patch 590294: os._execvpe security fix (Zack Weinberg).
1) Do not attempt to exec a file which does not exist
just to find out what error the operating system
returns. This is an exploitable race on all platforms
that support symbolic links.

2) Immediately re-raise the exception if we get an
error other than errno.ENOENT or errno.ENOTDIR. This
may need to be adapted for other platforms.

(As a security issue, this should be considered for 2.1
and 2.2 as well as 2.3.)
2002-08-05 16:13:24 +00:00
Fred Drake cadb9eb8f6 Be consistent with the functions in the posix/nt module: docstrings
don't include a " -> None" for functions that have no return value.
2002-07-02 21:28:04 +00:00