Commit Graph

57 Commits

Author SHA1 Message Date
Skip Montanaro
4c9fefcfe3 backport fix for missing altsep in nt (bug 709428) 2003-03-28 22:31:41 +00:00
Raymond Hettinger
9c1d3e46bb Change UserDict to IterableUserDict 2002-09-07 04:49:09 +00:00
Raymond Hettinger
aa36d87f0e Have os.environ inherit from the iterable version of UserDict.
Closes SF bug 605731.
2002-09-06 19:35:22 +00:00
Guido van Rossum
10c7ab740c Backport:
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:59 +00:00
Guido van Rossum
f1045ad2f2 Backport of 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.
2002-08-08 19:35:53 +00:00
Michael W. Hudson
09a5bd8c48 backport my checkin of
revision 1.54 of os.py

Fix

[ 530236 ] os.py assumes existence of statvfs_resul

This was pretty dense of me.  Sorry.

2.2.1 candidate.
2002-03-16 18:02:20 +00:00
Michael W. Hudson
2b85b37410 backport my checkin of
revision 1.52 of os.py

revision 1.52
date: 2002/03/06 17:11:17;  author: mwh;  state: Exp;  lines: +20 -0
Special support for pickling os.stat and os.stat_vfs results portably
(the types come from different modules on different platforms).

Added tests for pickling these types.

May be a bugfix candidate.
2002-03-07 10:12:11 +00:00
Tim Peters
1633a2e345 Whitespace normalization. 2001-10-30 05:56:40 +00:00
Guido van Rossum
e2ae77b8b8 SF patch #474590 -- RISC OS support 2001-10-24 20:42:55 +00:00
Guido van Rossum
c524d952da SF patch #460805 by Chris Gonnerman: Support for unsetenv()
This adds unsetenv to posix, and uses it in the __delitem__ method of
os.environ.

(XXX Should we change the preferred name for putenv to setenv, for
consistency?)
2001-10-19 01:31:59 +00:00
Martin v. Löwis
a90f438d4a Unify _Environ processing on riscos with other platforms. 2001-03-07 09:05:45 +00:00
Skip Montanaro
81e4b1c5c8 fix typo in extending __all__ for riscos platform - closes bug 406296 2001-03-06 15:26:07 +00:00
Ka-Ping Yee
feb6719851 Use r""" instead of """ for the docstring so that backslashes are preserved. 2001-03-02 23:31:43 +00:00
Guido van Rossum
b7fe432a88 Fix by Donn Cave for BeOS (SF #403642):
UNIX style fork/execve/wait are not fully compatible with thread
  support on BeOS.  For Python, that means neither fork() from import
  nor import from a fork work reliably. os._execvpe() does the latter,
  importing tempfile to set up a tantalizing target for hackers. This
  patch replaces both the tempfile name generation and the exec that
  uses it, in case we're on BeOS. Need this for
  setup:distutils:execvp(); symptoms are random crashes and internal
  BeOS error messages about th name, in case we're on BeOS. It's an
  issue because setup.py + distutils calls os.execvp(); symptoms are
  random crashes during setup.py, and internal BeOS error messages
  about thread IDs.
2001-03-02 07:04:51 +00:00
Guido van Rossum
d74fb6b12a RISCOS changes by dschwertberger. 2001-03-02 06:43:49 +00:00
Skip Montanaro
6c0a0e1538 added some elements missing from __all__ 2001-02-28 01:00:58 +00:00
Skip Montanaro
269b83bc05 added several more __all__ lists 2001-02-06 01:07:02 +00:00
Tim Peters
2344fae6d0 Whitespace normalization. 2001-01-15 00:50:52 +00:00
Fred Drake
20af3172ce popen4(): Added for Unix.
Fixed a typo in a docstring.
2000-09-28 19:10:56 +00:00
Guido van Rossum
d9a8e96543 Only supply popen2, popen3 when fork exists.
(This avoids defining non-working versions of these on the Mac.)
2000-09-19 03:04:52 +00:00
Fred Drake
31f182e830 Added os.popen2() and os.popen3() for non-Windows platforms. 2000-08-28 17:20:05 +00:00
Fred Drake
9f2550f581 makedirs(), removedirs(): If the tail of the path is empty, do a second
split so the logic does not fail in corner cases.

This closes bug #407.
2000-07-25 15:16:40 +00:00
Thomas Wouters
7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").

There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-16 12:04:32 +00:00
Guido van Rossum
868b50af17 Michael Hudson fixes a case where execv() is called (for a test) with
an empty argument list -- another patch he's checking in will make
this illegal (the first argument should always be the program name).
2000-04-26 20:32:08 +00:00
Guido van Rossum
7da3cc5dfb Michael Hudson:
I think that after this patch, all objects in the os module (with names
that don't start with "_") that can have docstrings, do, on Linux at
least.

Also fix a nit in one of my spawn* docstrings.
2000-04-25 10:53:22 +00:00