summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
Commit message (Collapse)AuthorAgeFilesLines
* test_os: remove now useless TemporaryFileTests testcaseVictor Stinner2011-07-011-111/+6
| | | | | | | | TemporaryFileTests has tests for os.tempnam() and os.tmpfile(), functions removed from Python 3. Move fdopen() tests to the FileTests testcase to test fdopen() on a file descriptor, not on a directory descriptor (which raises an error on Windows).
* test_os: add TemporaryFileTests to the testcase listVictor Stinner2011-07-011-0/+1
| | | | The testcase was never executed, it's now fixed.
* Issue #12451: Open files in binary mode in some tests when the text file is notVictor Stinner2011-06-301-7/+6
| | | | | | needed. Remove also an unused variable (blank) in test_threading.
* Fix #12084. os.stat on Windows wasn't working properly with relative symlinks.Brian Curtin2011-06-131-0/+45
| | | | | | | | | | | Use of DeviceIoControl to obtain the symlink path via the reparse tag was removed. The code now uses GetFinalPathNameByHandle in the case of a symbolic link and works properly given the added test which creates a symbolic link and calls os.stat on it from multiple locations. Victor Stinner also noticed an issue with os.lstat following the os.stat code path when being passed bytes. The posix_lstat function was adjusted to properly hook up win32_lstat instead of the previous STAT macro (win32_stat).
* Issue #11395: io.FileIO().write() clamps the data length to 32,767 bytes onVictor Stinner2011-03-201-0/+19
| | | | | | | Windows if the file is a TTY to workaround a Windows bug. The Windows console returns an error (12: not enough space error) on writing into stdout if stdout mode is binary and the length is greater than 66,000 bytes (or less, depending on heap usage).
* #11515: Merge with 3.1.Ezio Melotti2011-03-151-2/+2
|\
| * #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-2/+2
| |
| * Merged revisions 87666 via svnmerge fromAmaury Forgeot d'Arc2011-01-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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. ........
| * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-15/+15
| | | | | | | | | | | | | | | | | | | | 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. ........
| * Merged revisions 85987 via svnmerge fromBrian Curtin2010-10-301-8/+10
| | | | | | | | | | | | | | | | | | | | 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. ........
| * Merged revisions 80108,80111,80114-80115 via svnmerge fromMark Dickinson2010-04-161-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r80108 | victor.stinner | 2010-04-16 13:23:43 +0100 (Fri, 16 Apr 2010) | 4 lines Add CS_GNU_LIBC_VERSION and CS_GNU_LIBPTHREAD_VERSION constants for constr(), and disable test_execvpe_with_bad_program() of test_os if the libc uses linuxthreads to avoid the "unknown signal 32" bug (see issue #4970). ........ r80111 | mark.dickinson | 2010-04-16 13:47:52 +0100 (Fri, 16 Apr 2010) | 1 line Keep confstr entries in alphabetical order. ........ r80114 | mark.dickinson | 2010-04-16 14:45:35 +0100 (Fri, 16 Apr 2010) | 1 line Issue #4970: move linuxthreads check outside the affected test, and use skipIf ........ r80115 | mark.dickinson | 2010-04-16 14:51:27 +0100 (Fri, 16 Apr 2010) | 1 line Don't assume that os.confstr_names exists. ........
| * Merged revisions 78739 via svnmerge fromv3.1.2rc1Benjamin Peterson2010-03-061-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78739 | benjamin.peterson | 2010-03-06 14:34:24 -0600 (Sat, 06 Mar 2010) | 10 lines Merged revisions 78718 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78718 | gregory.p.smith | 2010-03-06 01:35:19 -0600 (Sat, 06 Mar 2010) | 3 lines Call setreuid and setregid in a subprocess to avoid altering the test runner's process state. Should fix issue8045. ........ ................
| * Merged revisions 78548 via svnmerge fromGregory P. Smith2010-03-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78548 | gregory.p.smith | 2010-02-28 21:54:14 -0800 (Sun, 28 Feb 2010) | 10 lines 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. ........ ................
| * Merged revisions 78316 via svnmerge fromEzio Melotti2010-02-221-0/+8
| | | | | | | | | | | | | | | | | | | | 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 77571 via svnmerge fromAntoine Pitrou2010-01-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r77571 | antoine.pitrou | 2010-01-17 13:16:23 +0100 (dim., 17 janv. 2010) | 4 lines Issue #7561: Fix crashes when using bytearray objects with the posix module. ........
| * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-7/+7
| | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
| * Merged revisions 74171 via svnmerge fromR. David Murray2009-07-221-1/+12
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r74171 | r.david.murray | 2009-07-22 11:20:27 -0400 (Wed, 22 Jul 2009) | 3 lines Issue 6542: Make sure that TestInvalidFD.test_closerange does not close any valid file descriptors. ........
* | #8278: In the Windows implementation of stat() and utime(),Amaury Forgeot d'Arc2011-01-031-0/+5
| | | | | | | | | | 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.
* | Fix #9333. The symlink function is always available now, raising OSErrorBrian Curtin2010-12-281-3/+3
| | | | | | | | when the user doesn't hold the symbolic link privilege rather than hiding it.
* | Avoid possible zombi process.Hirokazu Yamamoto2010-12-051-2/+4
| |
* | Fix #9333. Expose os.symlink on Windows only when usable.Brian Curtin2010-12-021-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to create symlinks on Windows, SeCreateSymbolicLinkPrivilege is an account privilege that is required to be held by the user. Not only must the privilege be enabled for the account, the activated privileges for the currently running application must be adjusted to enable the requested privilege. Rather than exposing an additional function to be called prior to the user's first os.symlink call, we handle the AdjustTokenPrivileges Windows API call internally and only expose os.symlink when the privilege escalation was successful. Due to the change of only exposing os.symlink when it's available, we can go back to the original test skipping methods of checking via `hasattr`.
* | Issue 9299 Add exist_ok parameter to os.makedirs to suppress 'File exists' ↵Terry Reedy2010-12-021-0/+22
| | | | | | | | exception. Patch by Ray Allen.
* | Fix #10591. Fix test_os for refleak runs.Brian Curtin2010-11-301-2/+1
| | | | | | | | Split a common setUp/tearDown into the appropriate parts.
* | Actually fix what I attempted to fix in r86888...Brian Curtin2010-11-301-3/+3
| |
* | Try to fix failures on platforms that can't encode the test characters.Brian Curtin2010-11-301-1/+6
| | | | | | | | Skip the test if encoding fails.
* | Fix for #8879.Brian Curtin2010-11-281-0/+5
| | | | | | | | | | | | | | Amaury noticed that this was originally written in a way that would fail on names that can't be encoded with the mbcs codec. Restructured the function to work with wide names first then narrow names second, to fall in line with the way other functions are written in posixmodule.c.
* | Fix #8879. Add os.link support to Windows.Brian Curtin2010-11-241-0/+28
| | | | | | | | | | | | | | | | Additionally, the st_ino attribute of stat structures was not being filled in. This was left out of the fix to #10027 and was noticed due to test_tarfile failing when applying the patch for this issue. An earlier version of the fix to #10027 included st_ino, but that attribute got lost in the shuffle of a few review/fix cycles. All tests pass.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-21/+21
| |
* | Close subprocess pipes in _kill. Fixes a number of ResourceWarnings.Brian Curtin2010-11-051-0/+3
| |
* | Fix #10257. Clear resource warnings by using os.popen's context manager.Brian Curtin2010-10-301-8/+10
| |
* | Issue #10210: os.get_exec_path() ignores BytesWarning warningsVictor Stinner2010-10-291-1/+4
| |
* | Fix #10098. Fix sporadic test_os failures.Brian Curtin2010-10-151-1/+1
| | | | | | | | | | Amaury noticed that we're not waiting for the subprocess to be ready -- it should be checking for 1, not 0.
* | Issue #9992: Remove PYTHONFSENCODING environment variable.Victor Stinner2010-10-131-30/+0
| |
* | Issue #9978: Wait until subprocess completes initialization. (Win32KillTests ↵Hirokazu Yamamoto2010-10-081-2/+14
| | | | | | | | in test_os)
* | LoginTests fails on a number of buildbots with different errors. SkipBrian Curtin2010-09-241-0/+3
| | | | | | | | it for now until a buildbot-safe solution comes up.
* | #9808. Implement os.getlogin for Windows, completed by Jon Anglin.Brian Curtin2010-09-231-0/+8
| | | | | | | | | | | | | | The test is semi-dumb, it just makes sure something comes back since we don't have a solid source to validate the returned login. We can't be 100% sure that the USERNAME env var will always match what os.getlogin() returns, so we don't make any specific assertion there.
* | Issue #9908: Fix os.stat() on bytes paths under Windows 7.Antoine Pitrou2010-09-211-2/+11
| |
* | Issue #8603: Environ.data is now protected -> Environ._dataVictor Stinner2010-09-101-1/+0
| | | | | | | | | | 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.
* | #6394: Add os.getppid() support for Windows.Amaury Forgeot d'Arc2010-09-071-0/+12
| |
* | Workaround issue #8611 in test_undecodable_code() of test_sysVictor Stinner2010-08-201-9/+6
| | | | | | | | | | Write test.support.workaroundIssue8611() function so it will be easier to remove this workaround from all tests.
* | Skip test_encodings() of test_os on Windows and Mac OS XVictor Stinner2010-08-191-0/+2
| |
* | Fix os.get_exec_path() (code and tests) for python -bbVictor Stinner2010-08-191-3/+10
| | | | | | | | Catch BytesWarning exceptions.
* | Fix test_os: workaround #8611 bugVictor Stinner2010-08-191-2/+9
| |
* | Create os.fsdecode(): decode from the filesystem encoding with surrogateescapeVictor Stinner2010-08-191-15/+38
| | | | | | | | | | | | | | | | 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
* | Improve PEP 383 tests (in test_os)Victor Stinner2010-08-181-15/+41
| | | | | | | | | | | | | | | | | | | | | | * Use the current filesystem encoding instead of always using utf-8 * Enable the test on Mac OS X * Use TESTFN_UNENCODABLE and TESTFN_UNICODE instead of arbitrary filenames * To decode a filename, use strict error handler instead surrogateescape for mbcs encoding (on Windows) * Use TESTFN_UNENCODABLE (if available) for the directory name Skip the test if no non-ascii filename can be created.
* | Update test_os.py according to my last changes on _Environ.__repr__()Victor Stinner2010-07-291-1/+3
| |
* | Re-flow several long lines from #1578269.Brian Curtin2010-07-091-1/+2
| |
* | Implement #1578269. Patch by Jason R. Coombs.Brian Curtin2010-07-081-2/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added Windows support for os.symlink when run on Windows 6.0 or greater, aka Vista. Previous Windows versions will raise NotImplementedError when trying to symlink. Includes numerous test updates and additions to test_os, including a symlink_support module because of the fact that privilege escalation is required in order to run the tests to ensure that the user is able to create symlinks. By default, accounts do not have the required privilege, so the escalation code will have to be exposed later (or documented on how to do so). I'll be following up with that work next. Note that the tests use ctypes, which was agreed on during the PyCon language summit.
* | Merged revisions 82403 via svnmerge fromBenjamin Peterson2010-06-301-0/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r82403 | benjamin.peterson | 2010-06-30 12:11:08 -0500 (Wed, 30 Jun 2010) | 1 line mark test depending on ref counting ........
* | Merged revisions 81584 via svnmerge fromBrian Curtin2010-05-281-6/+50
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81584 | brian.curtin | 2010-05-28 10:49:21 -0500 (Fri, 28 May 2010) | 3 lines 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. ........