summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix #9333. Expose os.symlink on Windows only when usable.Brian Curtin2010-12-021-8/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* | Include structseq.h in Python.h, and remove now-redundant includes in ↵Georg Brandl2010-11-301-1/+0
| | | | | | | | individual sources.
* | Fix for #8879.Brian Curtin2010-11-281-2/+18
| | | | | | | | | | | | | | 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.
* | Windows: fix leak in posix_listdir.Stefan Krah2010-11-271-0/+1
| |
* | Fix additional leaks.Stefan Krah2010-11-271-0/+2
| |
* | Further indentation cleanup.Stefan Krah2010-11-261-49/+49
| |
* | Issue #10383: Fix two leaks.Stefan Krah2010-11-261-7/+11
| |
* | Fix #8879. Add os.link support to Windows.Brian Curtin2010-11-241-0/+32
| | | | | | | | | | | | | | | | 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.
* | ifdef a Windows specific section.Brian Curtin2010-11-241-0/+2
| |
* | Fix #10027. st_nlink not set on Windows calls to os.stat/lstat.Brian Curtin2010-11-241-302/+279
| | | | | | | | | | | | Note: This patch has no tests because as of now there is no way to create links. #8879 adds that and the tests will go in there. I've manually observed that existing links on my system function properly with this.
* | Issue #10143: Update "os.pathconf" valuesJesus Cea2010-10-251-0/+33
| |
* | Fix a typo. full->finalBrian Curtin2010-09-241-1/+1
| |
* | #9808. Implement os.getlogin for Windows, completed by Jon Anglin.Brian Curtin2010-09-231-2/+15
| | | | | | | | | | | | | | 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-17/+31
| |
* | Remove unused code in posixmodule.cAmaury Forgeot d'Arc2010-09-171-68/+0
| |
* | Remove C++-style commentsAntoine Pitrou2010-09-141-2/+2
| |
* | Issue #9579, #9580: Fix os.confstr() for value longer than 255 bytes and encodeVictor Stinner2010-09-101-20/+22
| | | | | | | | | | the value with filesystem encoding and surrogateescape (instead of utf-8 in strict mode).
* | Untabify file.Amaury Forgeot d'Arc2010-09-101-3/+3
| |
* | #6394: Add os.getppid() support for Windows.Amaury Forgeot d'Arc2010-09-071-2/+52
| |
* | Implement #7566 - os.path.sameopenfile for Windows.Brian Curtin2010-09-061-0/+28
| | | | | | | | | | | | This uses the GetFileInformationByHandle function to return a tuple of values to identify a file, then ntpath.sameopenfile compares file tuples, which is exposed as os.path.sameopenfile.
* | #9747: fix copy-paste error in getresgid() doc.Georg Brandl2010-09-051-1/+1
| |
* | Issue #7736: Release the GIL around calls to opendir() and closedir()Antoine Pitrou2010-09-041-1/+10
| | | | | | | | in the posix module. Patch by Marcin Bachry.
* | #7647: add ST_RDONLY, ST_NOSUID constants to os module.Andrew M. Kuchling2010-08-181-0/+8
| | | | | | | | (Also fix a name ordering in the ACKS file.)
* | r82659 reintroduced some tab characters. Untabify again.Amaury Forgeot d'Arc2010-08-161-7/+7
| |
* | Fix other warnings under 64-bit Windows.Antoine Pitrou2010-08-151-4/+5
| |
* | Issue #9605: posix.getlogin() decodes the username with file filesystemVictor Stinner2010-08-151-4/+3
| | | | | | | | | | | | encoding and surrogateescape error handler. Patch written by David Watson. Reindent also posix_getlogin(), and fix a typo in the NEWS file.
* | Issue #9604: posix.initgroups() encodes the username using the fileystemVictor Stinner2010-08-151-2/+8
| | | | | | | | encoding and surrogateescape error handler. Patch written by David Watson.
* | Issue #9603: posix.ttyname() and posix.ctermid() decode the terminal nameVictor Stinner2010-08-151-2/+2
| | | | | | | | | | using the filesystem encoding and surrogateescape error handler. Patch written by David Watson.
* | use pep 383 decoding for mknod and mkfifo #9570Benjamin Peterson2010-08-111-2/+10
| | | | | | | | Patch by David Watson.
* | Issue #6915: Under Windows, os.listdir() didn't release the GlobalAntoine Pitrou2010-08-091-1/+5
| | | | | | | | Interpreter Lock around all system calls. Original patch by Ryan Kelly.
* | Issue 9445: Fix undefined symbols on VS8.0 build.Raymond Hettinger2010-08-011-0/+9
| |
* | 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.
* | Issue #6095: Make directory argument to os.listdir optional.Martin v. Löwis2010-07-231-9/+21
| | | | | | | | Patch by Virgil Dupras.
* | Re-flow several long lines from #1578269.Brian Curtin2010-07-091-11/+23
| |
* | Implement #1578269. Patch by Jason R. Coombs.Brian Curtin2010-07-081-20/+526
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 82047 via svnmerge fromSenthil Kumaran2010-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | 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 ........
* | Remove unused variable, and fix a compilation warning on Windows.Amaury Forgeot d'Arc2010-05-151-1/+1
| |
* | posix_listdir(), posix_readlink(): avoid temporary PyBytes objectVictor Stinner2010-05-141-38/+10
| | | | | | | | | | | | Use directly PyUnicode_DecodeFSDefaultAndSize() instead of PyBytes_FromStringAndSize() + PyUnicode_FromEncodedObject() if the argument is unicode.
* | posix_error_with_allocated_filename() decodes the filename withVictor Stinner2010-05-081-2/+6
| | | | | | | | | | | | PyUnicode_DecodeFSDefaultAndSize() and call PyErr_SetFromErrnoWithFilenameObject() instead of PyErr_SetFromErrnoWithFilename()
* | Replace PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,Victor Stinner2010-05-071-1/+1
| | | | | | | | "surrogateescape") by PyUnicode_DecodeFSDefault(val).
* | Issue #8603: Create a bytes version of os.environ for UnixVictor Stinner2010-05-061-24/+55
| | | | | | | | | | | | | | Create os.environb mapping and os.getenvb() function, os.unsetenv() encodes str argument to the file system encoding with the surrogateescape error handler (instead of utf8/strict) and accepts bytes, and posix.environ keys and values are bytes.
* | Recorded merge of revisions 80844-80845 via svnmerge fromVictor Stinner2010-05-061-3871/+3872
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Issue #8391: os.execvpe() and os.getenv() supports unicode with surrogates andVictor Stinner2010-04-231-167/+91
| | | | | | | | bytes strings for environment keys and values
* | Issue #8485: PyUnicode_FSConverter() doesn't accept bytearray object anymore,Victor Stinner2010-04-221-128/+95
| | | | | | | | you have to convert your bytearray filenames to bytes
* | Keep confstr entries in alphabetical order.Mark Dickinson2010-04-161-6/+6
| |
* | Add CS_GNU_LIBC_VERSION and CS_GNU_LIBPTHREAD_VERSION constants for constr(),Victor Stinner2010-04-161-0/+6
| | | | | | | | | | 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).
* | Issue #8412: os.system() now accepts bytes, bytearray and str withVictor Stinner2010-04-161-6/+11
| | | | | | | | surrogates.
* | Port #1220212 (os.kill for Win32) to py3k.Brian Curtin2010-04-121-0/+48
| |
* | Change PARSE_PID to _Py_PARSE_PID (cleanup for r78946).Gregory P. Smith2010-03-141-9/+9
| |
* | * Replaces the internals of the subprocess module from fork through exec onGregory P. Smith2010-03-141-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX systems with a C extension module. This is required in order for the subprocess module to be made thread safe. The pure python implementation is retained so that it can continue to be used if for some reason the _posixsubprocess extension module is not available. The unittest executes tests on both code paths to guarantee compatibility. * Moves PyLong_FromPid and PyLong_AsPid from posixmodule.c into longobject.h. Code reviewed by jeffrey.yasskin at http://codereview.appspot.com/223077/show