summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* (Merge 3.2) posixmodule.c: fix function name in argument parsingVictor Stinner2011-06-171-9/+9
|\ | | | | | | | | | | Fix os.fchown() and os.open() Remove also trailing spaces and replace tabs by spaces.
| * posixmodule.c: fix function name in argument parsingVictor Stinner2011-06-171-22/+22
| | | | | | | | | | | | Fix os.fchown() and os.open() Remove also trailing spaces and replace tabs by spaces.
* | Merge 3.2 - update to the fix for #12084Brian Curtin2011-06-141-10/+11
|\ \ | |/
| * Correct completely broken os.stat behavior on Windows XP.Brian Curtin2011-06-141-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | After 1a3e8db28d49, Windows XP could not os.stat at all due to raising immediately when GetFinalPathNameByHandle wasn't available (pre-Vista). The proper behavior in that situation is to just not attempt a traversal rather than outright rejecting. This change additionally handles a failed malloc by setting the error code and returning false. Patch by Hirokazu Yamamoto.
| * branch merge?Brian Curtin2011-06-131-0/+40
| |\
* | \ branch mergeBrian Curtin2011-06-131-95/+142
|\ \ \
| * \ \ Merge from 3.2 for Issue #12084.Brian Curtin2011-06-131-95/+142
| |\ \ \ | | |/ /
| | * | Fix #12084. os.stat on Windows wasn't working properly with relative symlinks.Brian Curtin2011-06-131-96/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #9344: Add os.getgrouplist().Ross Lagerwall2011-06-101-0/+67
| | | |
* | | | Merge 3.2Brian Curtin2011-06-091-1/+4
|\ \ \ \ | | |_|/ | |/| |
| * | | Correction to 88e318166eaf - Issue #11583Brian Curtin2011-06-091-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Rather than wrapping the C _isdir function in a Python function, just import the C _isdir function directly. Additionally, add in the docstring which was left out.
* | | | Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.Brian Curtin2011-06-081-0/+37
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | By changing to the Windows GetFileAttributes API in nt._isdir we can figure out if the path is a directory without opening the file via os.stat. This has the minor benefit of speeding up os.path.isdir by at least 2x for regular files and 10-15x improvements were seen on symbolic links (which opened the file multiple times during os.stat). Since os.path.isdir is used in several places on interpreter startup, we get a minor speedup in startup time.
| * | | Fix #11583. Changed os.path.isdir to use GetFileAttributes instead of os.stat.Brian Curtin2011-06-081-0/+37
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | By changing to the Windows GetFileAttributes API in nt._isdir we can figure out if the path is a directory without opening the file via os.stat. This has the minor benefit of speeding up os.path.isdir by at least 2x for regular files and 10-15x improvements were seen on symbolic links (which opened the file multiple times during os.stat). Since os.path.isdir is used in several places on interpreter startup, we get a minor speedup in startup time.
* | | Issue #12196: Make os.pipe2() flags argument mandatory.Charles-François Natali2011-06-061-8/+9
| |/ |/|
* | Issue #12196: Add pipe2() to the os module.Charles-François Natali2011-05-291-0/+28
| |
* | Issue #6501: os.device_encoding() returns None on Windows if the applicationVictor Stinner2011-05-231-10/+13
| | | | | | | | has no console.
* | Issue #12105: Add O_CLOEXEC to the os module.Charles-François Natali2011-05-221-0/+3
| |
* | Issue #11918: OS/2 and VMS are no more supported because of the lack ofVictor Stinner2011-04-261-0/+2
| | | | | | | | maintainer.
* | Issue #11382: Trivial system calls, such as dup() or pipe(), needn'tAntoine Pitrou2011-04-231-14/+0
| | | | | | | | release the GIL. Patch by Charles-François Natali.
* | os.sendfile(): on Linux if offset parameter is passed as NULL we were ↵Giampaolo Rodola'2011-04-191-3/+2
| | | | | | | | erroneously returning a (bytes_sent, None) tuple instead of bytes_sent
* | Fix refleak introduced by #10812.Ross Lagerwall2011-03-191-13/+22
| |
* | Issue #11592: Fix compilation warnings in os module.Ross Lagerwall2011-03-181-4/+4
| |
* | Issue #10812: Revert os.lseek change.Ross Lagerwall2011-03-171-1/+7
| |
* | Issue #10812: Add some extra posix functions to the os module.Ross Lagerwall2011-03-171-152/+812
| |
* | #11515: Merge with 3.2.Ezio Melotti2011-03-151-1/+1
|\ \ | |/
| * #11515: Merge with 3.1.Ezio Melotti2011-03-151-1/+1
| |\
| | * Merged revisions 88111 via svnmerge fromAntoine Pitrou2011-01-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88111 | antoine.pitrou | 2011-01-19 16:21:35 +0100 (mer., 19 janv. 2011) | 4 lines Issue #10898: Allow compiling the posix module when the C library defines a symbol named FSTAT. ........
| | * Merged revisions 87802 via svnmerge fromAntoine Pitrou2011-01-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87802 | antoine.pitrou | 2011-01-06 19:25:55 +0100 (jeu., 06 janv. 2011) | 6 lines Issue #7858: Raise an error properly when os.utime() fails under Windows on an existing file. (this does not seem to be easily testable) ........
| | * Merged revisions 87666 via svnmerge fromAmaury Forgeot d'Arc2011-01-031-12/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 86808 via svnmerge fromStefan Krah2010-11-261-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86808 | stefan.krah | 2010-11-26 17:16:47 +0100 (Fri, 26 Nov 2010) | 1 line Further indentation cleanup. ........
| | * Merged revisions 86804 via svnmerge fromStefan Krah2010-11-261-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86804 | stefan.krah | 2010-11-26 13:58:05 +0100 (Fri, 26 Nov 2010) | 1 line Issue #10383: Fix two leaks. ........
| | * Merged revisions 84489 via svnmerge fromAntoine Pitrou2010-09-041-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84489 | antoine.pitrou | 2010-09-04 19:21:57 +0200 (sam., 04 sept. 2010) | 4 lines Issue #7736: Release the GIL around calls to opendir() and closedir() in the posix module. Patch by Marcin Bachry. ........
| | * Merged revisions 84076 via svnmerge fromAntoine Pitrou2010-08-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84076 | antoine.pitrou | 2010-08-15 20:07:50 +0200 (dim., 15 août 2010) | 4 lines Fix other warnings under 64-bit Windows. ........
| | * Merged revisions 84063 via svnmerge fromVictor Stinner2010-08-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84063 | victor.stinner | 2010-08-15 11:33:08 +0200 (dim., 15 août 2010) | 5 lines Issue #9605: posix.getlogin() decodes the username with file filesystem encoding and surrogateescape error handler. Patch written by David Watson. Reindent also posix_getlogin(), and fix a typo in the NEWS file. ........
| | * Merged revisions 84060 via svnmerge fromVictor Stinner2010-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84060 | victor.stinner | 2010-08-15 11:12:51 +0200 (dim., 15 août 2010) | 4 lines Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal name using the filesystem encoding and surrogateescape error handler. Patch written by David Watson. ........
| | * Merged revisions 83951 via svnmerge fromBenjamin Peterson2010-08-111-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83951 | benjamin.peterson | 2010-08-11 14:20:42 -0500 (Wed, 11 Aug 2010) | 4 lines use pep 383 decoding for mknod and mkfifo #9570 Patch by David Watson. ........
| | * Merged revisions 83921 via svnmerge fromAntoine Pitrou2010-08-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83921 | antoine.pitrou | 2010-08-10 01:39:31 +0200 (mar., 10 août 2010) | 4 lines Issue #6915: Under Windows, os.listdir() didn't release the Global Interpreter Lock around all system calls. Original patch by Ryan Kelly. ........
| | * This fixes issue7900 by adding code that dealsRonald Oussoren2010-07-231-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | with the fact that getgroups(2) might return more that MAX_GROUPS on OSX. See the issue (and python-dev archives) for the gory details. Summarized: OSX behaves rather oddly and Apple says this is intentional.
| | * Merged revisions 82049 via svnmerge fromSenthil Kumaran2010-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r82049 | senthil.kumaran | 2010-06-17 22:18:06 +0530 (Thu, 17 Jun 2010) | 9 lines Merged revisions 82047 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r82047 | senthil.kumaran | 2010-06-17 22:08:34 +0530 (Thu, 17 Jun 2010) | 3 lines Fix Issue4452 - Incorrect docstring of os.setpgrp ........ ................
| | * Revert r81171 (posix_listdir(), posix_readlink(): avoid temporary PyBytes ↵Victor Stinner2010-05-141-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | object) PyUnicode_DecodeFSDefault*() doesn't use surrogateescape error handler, and so PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, "surrogateescape") cannot be replaced by PyUnicode_DecodeFSDefault(). It's a bad idea to try to fix surrogates things in Python 3.1...
| | * Merged revisions 81170 via svnmerge fromVictor Stinner2010-05-141-38/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81170 | victor.stinner | 2010-05-14 18:35:39 +0200 (ven., 14 mai 2010) | 6 lines posix_listdir(), posix_readlink(): avoid temporary PyBytes object Use directly PyUnicode_DecodeFSDefaultAndSize() instead of PyBytes_FromStringAndSize() + PyUnicode_FromEncodedObject() if the argument is unicode. ........
| | * Recorded merge of revisions 80846 via svnmerge fromVictor Stinner2010-05-061-3884/+3885
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80846 | victor.stinner | 2010-05-06 02:08:46 +0200 (jeu., 06 mai 2010) | 20 lines Recorded merge of revisions 80844-80845 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80844 | victor.stinner | 2010-05-06 01:33:33 +0200 (jeu., 06 mai 2010) | 5 lines Untabify Modules/posixmodule.c Run Antoine Pitrou "untabify" script + manual editions (OS/2 and some continuation lines). ........ r80845 | victor.stinner | 2010-05-06 02:03:44 +0200 (jeu., 06 mai 2010) | 4 lines Untabify Modules/posixmodule.c (2) Fix some more functions by hand ........ I rewrote the patch for py3k from scratch using untabify + manual editions ................
| | * Merged revisions 80421,80424 via svnmerge fromVictor Stinner2010-04-251-167/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 80108,80111,80114-80115 via svnmerge fromMark Dickinson2010-04-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 80105 via svnmerge fromVictor Stinner2010-04-161-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r80105 | victor.stinner | 2010-04-16 13:45:13 +0200 (ven., 16 avril 2010) | 3 lines Issue #8412: os.system() now accepts bytes, bytearray and str with surrogates. ........
| | * Merged revisions 78548 via svnmerge fromGregory P. Smith2010-03-011-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 77571 via svnmerge fromAntoine Pitrou2010-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 77167 via svnmerge fromBenjamin Peterson2009-12-311-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77167 | benjamin.peterson | 2009-12-30 21:11:23 -0600 (Wed, 30 Dec 2009) | 61 lines Merged revisions 76847,76851,76869,76882,76891-76892,76924,77007,77070,77092,77096,77120,77126,77155 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76847 | benjamin.peterson | 2009-12-14 21:25:27 -0600 (Mon, 14 Dec 2009) | 1 line adverb ........ r76851 | benjamin.peterson | 2009-12-15 21:28:52 -0600 (Tue, 15 Dec 2009) | 1 line remove lib2to3 resource ........ r76869 | vinay.sajip | 2009-12-17 08:52:00 -0600 (Thu, 17 Dec 2009) | 1 line Issue #7529: logging: Minor correction to documentation. ........ r76882 | georg.brandl | 2009-12-19 11:30:28 -0600 (Sat, 19 Dec 2009) | 1 line #7527: use standard versionadded tags. ........ r76891 | georg.brandl | 2009-12-19 12:16:31 -0600 (Sat, 19 Dec 2009) | 1 line #7479: add note about function availability on Unices. ........ r76892 | georg.brandl | 2009-12-19 12:20:18 -0600 (Sat, 19 Dec 2009) | 1 line #7480: remove tautology. ........ r76924 | georg.brandl | 2009-12-20 08:28:05 -0600 (Sun, 20 Dec 2009) | 1 line Small indentation fix. ........ r77007 | gregory.p.smith | 2009-12-23 03:31:11 -0600 (Wed, 23 Dec 2009) | 3 lines Fix possible integer overflow in lchown and fchown functions. For issue1747858. ........ r77070 | amaury.forgeotdarc | 2009-12-27 14:06:44 -0600 (Sun, 27 Dec 2009) | 2 lines Fix a typo in comment ........ r77092 | georg.brandl | 2009-12-28 02:48:24 -0600 (Mon, 28 Dec 2009) | 1 line #7404: remove reference to non-existing example files. ........ r77096 | benjamin.peterson | 2009-12-28 14:51:17 -0600 (Mon, 28 Dec 2009) | 1 line document new fix_callable behavior ........ r77120 | georg.brandl | 2009-12-29 15:09:17 -0600 (Tue, 29 Dec 2009) | 1 line #7595: fix typo in argument default constant. ........ r77126 | amaury.forgeotdarc | 2009-12-29 17:06:17 -0600 (Tue, 29 Dec 2009) | 2 lines #7579: Add docstrings to the msvcrt module ........ r77155 | georg.brandl | 2009-12-30 13:03:00 -0600 (Wed, 30 Dec 2009) | 1 line We only support Windows NT derivatives now. ........ ................
| | * Merged revisions 75246 via svnmerge fromBenjamin Peterson2009-10-041-3/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75246 | benjamin.peterson | 2009-10-04 15:32:25 -0500 (Sun, 04 Oct 2009) | 29 lines Merged revisions 74841 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74841 | thomas.wouters | 2009-09-16 14:55:54 -0500 (Wed, 16 Sep 2009) | 23 lines Fix issue #1590864, multiple threads and fork() can cause deadlocks, by acquiring the import lock around fork() calls. This prevents other threads from having that lock while the fork happens, and is the recommended way of dealing with such issues. There are two other locks we care about, the GIL and the Thread Local Storage lock. The GIL is obviously held when calling Python functions like os.fork(), and the TLS lock is explicitly reallocated instead, while also deleting now-orphaned TLS data. This only fixes calls to os.fork(), not extension modules or embedding programs calling C's fork() directly. Solving that requires a new set of API functions, and possibly a rewrite of the Python/thread_*.c mess. Add a warning explaining the problem to the documentation in the mean time. This also changes behaviour a little on AIX. Before, AIX (but only AIX) was getting the import lock reallocated, seemingly to avoid this very same problem. This is not the right approach, because the import lock is a re-entrant one, and reallocating would do the wrong thing when forking while holding the import lock. Will backport to 2.6, minus the tiny AIX behaviour change. ........ ................
* | | Issue 11351 - apply patch by Steffen Daode Nurpmeso which should fix ↵Giampaolo Rodolà2011-03-031-13/+29
| | | | | | | | | | | | TestSendfile.test_headers failure on OSX.