Commit Graph

110 Commits

Author SHA1 Message Date
Antoine Pitrou 341016e8bf Fix sporadic test_os failure under Windows 2012-02-22 22:16:25 +01:00
Antoine Pitrou 0607f731f2 Fix flaky os.urandom test. 2012-02-21 22:02:04 +01:00
Benjamin Peterson 72949bd511 this was supposed to die 2012-02-20 22:33:33 -05:00
Benjamin Peterson aee9dfba4a merge 2.6 with hash randomization fix 2012-02-20 21:44:56 -05:00
Barry Warsaw 1e13eb084f - Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
environment variable, to provide an opt-in way to protect against denial of
  service attacks due to hash collisions within the dict and set types.  Patch
  by David Malcolm, based on work by Victor Stinner.
2012-02-20 20:42:21 -05:00
Charles-François Natali 27bc4d07cc Issue #13415: Skip test_os.test_unset_error on FreeBSD and OS X. 2011-11-27 13:05:14 +01:00
Victor Stinner 091b6ef793 Issue #13436: Fix unsetenv() test on Windows 2011-11-22 22:30:19 +01:00
Victor Stinner 53853c3fa9 Issue #13415: os.unsetenv() doesn't ignore errors anymore. 2011-11-22 22:20:13 +01:00
Ezio Melotti 24b07bcba3 #11515: fix several typos. Patch by Piotr Kasprzyk. 2011-03-15 18:55:01 +02:00
Amaury Forgeot d'Arc ac514c895c Merged revisions 87666 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87666 | amaury.forgeotdarc | 2011-01-03 01:19:11 +0100 (lun., 03 janv. 2011) | 4 lines

  #8278: In the Windows implementation of stat() and utime(),
  use time_t instead of int.  This gives support for dates after 2038,
  at least when compiled with VS2003 or later, where time_t is 64bit.
........
2011-01-03 00:50:57 +00:00
Antoine Pitrou b061461596 Issue #4662: os.tempnam(), os.tmpfile() and os.tmpnam() now raise a py3k
DeprecationWarning.
2011-01-02 20:04:52 +00:00
Ezio Melotti 2623a37852 Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line

  #9424: Replace deprecated assert* methods in the Python test suite.
........
2010-11-21 13:34:58 +00:00
Brian Curtin f4f0c8be3d Merged revisions 86198 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86198 | brian.curtin | 2010-11-05 10:17:11 -0500 (Fri, 05 Nov 2010) | 2 lines

  Close subprocess pipes in _kill. Fixes a number of ResourceWarnings.
........
2010-11-05 15:31:20 +00:00
Brian Curtin dbf8e839cf Backport r85525 from #10098. 2010-11-05 15:28:19 +00:00
Brian Curtin fcbf5d0ac1 Merged revisions 85987 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85987 | brian.curtin | 2010-10-30 16:24:21 -0500 (Sat, 30 Oct 2010) | 2 lines

  Fix #10257. Clear resource warnings by using os.popen's context manager.
........
2010-10-30 21:29:52 +00:00
Hirokazu Yamamoto 1f504f1d7a Merged revisions 85315 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85315 | hirokazu.yamamoto | 2010-10-08 17:38:15 +0900 | 1 line

  Issue #9978: Wait until subprocess completes initialization. (Win32KillTests in test_os)
........
2010-10-08 09:41:13 +00:00
Ezio Melotti 213bcb8de1 Fix buildbot failure in test_os.py 2010-08-03 10:44:09 +00:00
Ezio Melotti aad1541484 Fix deprecation warnings in test_os.py 2010-08-03 06:49:14 +00:00
Benjamin Peterson c262a69f54 an AttributeError is perfectly acceptable here 2010-06-30 18:41:08 +00:00
Benjamin Peterson 10947a6416 mark test depending on ref counting 2010-06-30 17:11:08 +00:00
Brian Curtin 83cba05c30 Fix #8405 for slow buildbots. Remove the sleep on startup and move the
pipe communication into a loop to retry in case a buildbot gets even slower.
2010-05-28 15:49:21 +00:00
Brian Curtin b3dde13413 Fix os.kill tests to be more robust and work with slower machines.
Rather than depending on some sleep value, start up an interpreter
as a subprocess and communicate with it. Because subprocess pipes
can't be read from until EOF and I want to read from them before that,
use ctypes to peek by using PeekNamedPipe. Once the subprocess has
written the message, then it is ready to roll and accept signals.
After that, kill it.
2010-04-15 00:40:40 +00:00
Brian Curtin 235350a142 Add a small sleep to let a subprocess start before terminating it.
David Bolen's buildbot isn't know for it's speed, and it seems that we
may have been trying to kill the subprocess before it was fully
initialized. I ran with this change on the bot itself and it seemed to work.
2010-04-14 02:24:24 +00:00
Brian Curtin fce1d31d47 Fix a failing test on an apparently slow Windows buildbot.
On slower Windows machines, waiting 0.1 seconds can sometimes not be
enough for a subprocess to start and be ready to accept signals, causing
the test to fail. One buildbot is also choking on input()/EOFError so
that was changed to not depend on input.
2010-04-05 19:04:23 +00:00
Brian Curtin e5aa886b44 Implement #1220212. Add os.kill support for Windows.
os.kill takes one of two newly added signals, CTRL_C_EVENT and
CTRL_BREAK_EVENT, or any integer value. The events are a special case
which work with subprocess console applications which implement a
special console control handler. Any other value but those two will
cause os.kill to use TerminateProcess, outright killing the process.

This change adds win_console_handler.py, which is a script to implement
SetConsoleCtrlHandler and applicable handler function, using ctypes.

subprocess also gets another attribute which is a necessary flag to
creationflags in Popen in order to send the CTRL events.
2010-04-02 23:26:06 +00:00
Matthias Klose a0dc275f08 Revert r79131
- Issue #1039, #8154: Fix os.execlp() crash with missing 2nd argument.
2010-03-21 11:15:45 +00:00
Matthias Klose b8022c8ad1 Merged revisions 79096 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79096 | matthias.klose | 2010-03-19 15:45:06 +0100 (Fr, 19 Mär 2010) | 2 lines

  - Issue #1039, #8154: Fix os.execlp() crash with missing 2nd argument.
........
2010-03-20 02:13:49 +00:00
Matthias Klose e9fbf2b943 - Issue #1039, #8154: Fix os.execlp() crash with missing 2nd argument. 2010-03-19 14:45:06 +00:00
Gregory P. Smith b608e6f8bb Merged revisions 78718 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78718 | gregory.p.smith | 2010-03-05 23:35:19 -0800 (Fri, 05 Mar 2010) | 3 lines

  Call setreuid and setregid in a subprocess to avoid altering the test runner's
  process state.  Should fix issue8045.
........
2010-03-07 05:58:43 +00:00
Gregory P. Smith 467298cb42 Call setreuid and setregid in a subprocess to avoid altering the test runner's
process state.  Should fix issue8045.
2010-03-06 07:35:19 +00:00
Gregory P. Smith 8baa745ceb Merged revisions 78546 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r78546 | gregory.p.smith | 2010-02-28 21:43:43 -0800 (Sun, 28 Feb 2010) | 3 lines

  Fixes issue #7999: os.setreuid() and os.setregid() would refuse to accept
  a -1 parameter on some platforms such as OS X.
........
2010-03-01 05:48:57 +00:00
Gregory P. Smith 6a65f85e79 Fixes issue #7999: os.setreuid() and os.setregid() would refuse to accept
a -1 parameter on some platforms such as OS X.
2010-03-01 05:43:43 +00:00
Georg Brandl a4f46e1292 Remove unused imports in test modules. 2010-02-07 17:03:15 +00:00
Ezio Melotti aa98058cc4 use assert[Not]In where appropriate 2010-01-23 23:04:36 +00:00
Mark Dickinson 1b34d2552c Issue #5080: turn the DeprecationWarning from float arguments passed
to integer PyArg_Parse* format codes into a TypeError.  Add a
DeprecationWarning for floats passed with the 'L' format code, which
didn't previously have a warning.
2010-01-01 17:27:30 +00:00
R. David Murray bce6d5e129 Remove unittest.SkipTest from backport of test for issue 6542. 2009-07-27 01:14:38 +00:00
R. David Murray ce28a01e35 Merged revisions 74175 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74175 | r.david.murray | 2009-07-22 13:22:58 -0400 (Wed, 22 Jul 2009) | 4 lines

  Backport of fix for issue 6542: make sure
  test_os.TestInvalidFD.test_closerange does not close any
  valid file descriptors.
........
2009-07-22 17:37:11 +00:00
R. David Murray 46ca2f25eb Backport of fix for issue 6542: make sure
test_os.TestInvalidFD.test_closerange does not close any
valid file descriptors.
2009-07-22 17:22:58 +00:00
Benjamin Peterson 5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Benjamin Peterson 757b3c90e6 use skipTest() 2009-05-16 18:44:34 +00:00
Gregory P. Smith dd7b6302ee Merged revisions 71299 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71299 | gregory.p.smith | 2009-04-05 16:43:58 -0700 (Sun, 05 Apr 2009) | 3 lines

  Fixes issue5705: os.setuid() and friends did not accept the same range of
  values that pwd.getpwnam() returns.
........
2009-04-06 06:47:37 +00:00
Gregory P. Smith 6d30793cf2 Fixes issue5705: os.setuid() and friends did not accept the same range of
values that pwd.getpwnam() returns.
2009-04-05 23:43:58 +00:00
Kristján Valur Jónsson e20f54f542 Fix a number of Win32ErrorTests error cases. chmod wasn't being tested. 'access' never raises an error. 2009-02-06 10:17:34 +00:00
Benjamin Peterson 1de05e9b2a check the errno in bad fd cases 2009-01-31 01:42:55 +00:00
Benjamin Peterson 1f01cd013f I'm sick of these deprecations warnings in test_os 2009-01-19 21:08:37 +00:00
Benjamin Peterson 29d9381625 Merged revisions 68779 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line

  make bad file descriptor tests more robust
........
2009-01-19 21:02:45 +00:00
Benjamin Peterson 5539c78391 make bad file descriptor tests more robust 2009-01-19 17:37:42 +00:00
Benjamin Peterson f5def21ce7 Merged revisions 68610,68621-68622,68649 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68610 | kristjan.jonsson | 2009-01-15 03:09:13 -0600 (Thu, 15 Jan 2009) | 3 lines

  Fix recently introduced test cases.
  For datetime, gentoo didn't seem to mind the %e format for strftime.  So, we just excercise those instead making sure that we don't crash.
  For test_os, two cases were incorrect.
........
  r68621 | kristjan.jonsson | 2009-01-15 16:40:03 -0600 (Thu, 15 Jan 2009) | 1 line

  Fix two test cases in test_os.  ftruncate raises IOError unlike all the others which raise OSError.  And close() on some platforms doesn't complain when given an invalid file descriptor.
........
  r68622 | kristjan.jonsson | 2009-01-15 16:46:26 -0600 (Thu, 15 Jan 2009) | 1 line

  Make all the invalid fd tests for os subject to the function being available.
........
  r68649 | benjamin.peterson | 2009-01-16 22:39:05 -0600 (Fri, 16 Jan 2009) | 1 line

  trying to find some fpathconf() settings that all unixs support...
........
2009-01-19 15:06:00 +00:00
Kristján Valur Jónsson 2e659ce36f Issue 4957
Let os.ftruncate raise OSError like documented.
2009-01-19 13:10:27 +00:00
Benjamin Peterson f320c22701 trying to find some fpathconf() settings that all unixs support... 2009-01-17 04:39:05 +00:00