summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-121-9/+0
|
* Backport gvanrossum's checkin of version 2.217:Michael W. Hudson2001-12-281-1/+1
| | | | | | | Due to a cut-and-paste error, the type object exported under the name statvfs_result was in fact the stat_result type object. :-( 2.2.1 bugfix!
* SF bug #495021: Crash calling os.stat with a trailing backslashTim Peters2001-12-191-14/+20
| | | | | | | Patch from Mark Hammond, plus code rearrangement and comments from me. posix_do_stat(): Windows-specific code could try to free() stack memory in some cases when a path ending with a forward or backward slash was passed to os.stat().
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-081-0/+2
| | | | | | | | | | | | | type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
* SF patch #489173: Make os.spawnv not block the interpreter, fromTim Peters2001-12-071-3/+10
| | | | | | | | | | | | Anthony Roach. Release the global interpreter lock around platform spawn calls. Bugfix candidate? Hard to say; I favor "yes, bugfix". These clearly *should* have been releasing the GIL all along, if for no other reason than compatibility with the similar os.system(). But it's possible some program out there is (a) multithreaded, (b) calling a spawn function with P_WAIT, and (c) relying on the spawn call to block all their threads until the spawned program completes. I think it's very unlikely anyone is doing that on purpose, but someone may be doing so by accident.
* posix_execve(), posix_spawnve(), posix_putenv():Tim Peters2001-12-031-6/+14
| | | | | sprintf -> PyOS_snprintf. This is the last of this stuff I intend to do.
* More sprintf -> PyOS_snprintf.Tim Peters2001-11-281-3/+3
|
* Repair a botched PyOS_snprintf conversion.Tim Peters2001-11-281-1/+1
|
* sprintf -> PyOS_snprintf in some "obviously safe" cases.Tim Peters2001-11-281-3/+5
| | | | | Also changed <>-style #includes to ""-style in some places where the former didn't make sense.
* Fixes for possible buffer overflows in sprintf() usages.Marc-André Lemburg2001-11-281-1/+1
|
* Correct typo. Fixes #484611.Martin v. Löwis2001-11-241-1/+1
|
* Patch #474169: Move fdopen calls out of critical section.Martin v. Löwis2001-11-021-4/+8
|
* SF patch #460805 by Chris Gonnerman: Support for unsetenv()Guido van Rossum2001-10-191-0/+34
| | | | | | | | 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?)
* Expose O_LARGEFILE, O_DIRECT, O_DIRECTORY, and O_NOFOLLOW.Martin v. Löwis2001-10-181-0/+17
|
* Don't leave bare newlines in long strings -- VC doesn't like that.Guido van Rossum2001-10-181-3/+3
|
* SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.Guido van Rossum2001-10-181-68/+178
| | | | | | | | | | | | | | | | | This is a big one, touching lots of files. Some of the platforms aren't tested yet. Briefly, this changes the return value of the os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the time functions localtime(), gmtime(), and strptime() from tuples into pseudo-sequences. When accessed as a sequence, they behave exactly as before. But they also have attributes like st_mtime or tm_year. The stat return value, moreover, has a few platform-specific attributes that are not available through the sequence interface (because everybody expects the sequence to have a fixed length, these couldn't be added there). If your platform's struct stat doesn't define st_blksize, st_blocks or st_rdev, they won't be accessible from Python either. (Still missing is a documentation update.)
* Shut up warnings for setgroups() on Linux -- you have to #includeGuido van Rossum2001-10-181-0/+5
| | | | <grp.h> it seems. This requires yet another configure test.
* Expose setgroups. Fixes feature request #468116.Martin v. Löwis2001-10-181-0/+48
|
* Add chroot call. Implements feature #459267.Martin v. Löwis2001-10-041-0/+15
|
* Enable large file support on Win32 systems.Tim Peters2001-09-061-3/+3
| | | | | | | | | Curious: the MS docs say stati64 etc are supported even on Win95, but Win95 doesn't support a filesystem that allows partitions > 2 Gb. test_largefile: This was opening its test file in text mode. I have no idea how that worked under Win64, but it sure needs binary mode on Win98. BTW, on Win98 test_largefile runs quickly (under a second).
* SF bug [#456252] Python should never stomp on [u]intptr_t.Tim Peters2001-08-291-4/+4
| | | | | | | | | | | pyport.h: typedef a new Py_intptr_t type. DELICATE ASSUMPTION: That HAVE_UINTPTR_T implies intptr_t is available as well as uintptr_t. If that turns out not to be true, things must get uglier (C99 wants both, so I think it's an assumption we're *likely* to get away with). thread_nt.h, PyThread_start_new_thread: MS _beginthread is documented as returning unsigned long; no idea why uintptr_t was being used. Others: Always use Py_[u]intptr_t, never [u]intptr_t directly.
* SF patch [ #455137 ] Makes popen work with COMMAND.COM on WNT, fromTim Peters2001-08-271-9/+22
| | | | Brian Quinlan.
* added warnings about security risk of using tmpnam and tempnamSkip Montanaro2001-08-181-0/+10
|
* Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.Martin v. Löwis2001-07-261-1/+1
|
* Remove warnings from the SGI compiler.Fred Drake2001-07-191-1/+1
| | | | This is part of SF patch #434992.
* On Windows, tempnam() is spelled with a leading underscore.Fred Drake2001-07-171-0/+4
|
* Re-do the broken-nice() patch to break less platforms. Hopefully none :PThomas Wouters2001-07-111-3/+9
| | | | | | | Also note that it isn't just Linux nice() that is broken: at least FreeBSD and BSDI also have this problem. os.nice() should probably just be emulated using getpriority()/setpriority(), if they are available, but I'll get to that later.
* Patch #439995 (slightly modified from the uploaded version):Thomas Wouters2001-07-111-1/+18
| | | | | | | Work around Linux's nonstandard nice() systemcall, which does not return the new priority. This closes SF bug #439990.
* SF patch #418147 Fixes to allow compiling w/ Borland, from Stephen Hansen.Tim Peters2001-05-141-10/+8
|
* Fix the Py_FileSystemDefaultEncoding checkin - declare the variable in a ↵Mark Hammond2001-05-141-10/+0
| | | | fileobject.h, and initialize it in bltinmodule.
* Add support for Windows using "mbcs" as the default Unicode encoding when ↵Mark Hammond2001-05-131-40/+99
| | | | dealing with the file system. As discussed on python-dev and in patch 410465.
* Make some private symbols static.Guido van Rossum2001-04-141-1/+1
|
* Unixware 7 support by Billy G. Allie (SF patch 413011)Guido van Rossum2001-04-111-0/+30
|
* conditionally include unistd.h to pick up confstr declaration. attempt toSkip Montanaro2001-02-271-0/+5
| | | | | squelch warning from GCC 2.95.2 on Solaris - partially addresses bug #232787.
* Add a few more missing prototypes to the SunOS 4.1.4 section (no SFThomas Wouters2001-02-151-0/+3
| | | | | bugreport, just an IRC one by Marion Delgado.) These prototypes are necessary because the functions are tossed around, not just called.
* Partial fix to [ Bug #128685 ] popen on Win9x isnt smart enough about ↵Mark Hammond2001-01-311-9/+45
| | | | | | | | finding w9xpopen.exe. "Partial" as the code uses sys.prefix in an attempt to locate 'w9xpopen.exe', but sys.prefix is not set if Python can't find it itself. So this _still_ fails in Pythonwin, but I am committing the patch for 2 reasons: * Embedded apps that set sys.prefix or use PYTHONHOME will work * The exception raised on failure to find the executable is far more obvious
* Fix Bug #125891 - os.popen2,3 and 4 leaked file objects on Windows.Mark Hammond2001-01-311-0/+5
|
* Plug memory leak.Neil Schemenauer2001-01-161-1/+2
|
* Anonymous SF bug report #128053 point out that the #ifdef forGuido van Rossum2001-01-081-1/+1
| | | | | including "tmpfile" in the posix_methods[] array is wrong -- should be HAVE_TMPFILE, not HAVE_TMPNAM.
* Trivial typo fix, submitted by Charles Waldman (SF patch #102794).Guido van Rossum2000-12-121-1/+1
|
* posix_getlogin(): Be more cautious about interpreting a NULL fromFred Drake2000-12-061-1/+1
| | | | | getlogin() -- it is not clear that a NULL is always an error.
* posix_getlogin(): Handle the possibility that getlogin() can returnFred Drake2000-12-061-3/+12
| | | | | | | NULL without setting errno; observed on Linux Mandrake 7.2 by an anonymous user. This closes bug #124758.
* Ka-Ping Yee <ping@lfw.org>:Fred Drake2000-10-241-28/+28
| | | | | | Changes to error messages to increase consistency & clarity. This (mostly) closes SourceForge patch #101839.
* Clarify that isatty is only guaranteed to return true for slave ends ofThomas Wouters2000-10-031-1/+1
| | | | terminals, not the master end (though it does, on most systems.)
* Add missing prototypes for the benefit of SunOS 4.1.4 */Guido van Rossum2000-09-251-0/+7
|
* It's better to test for __hpux rather than __hppa, and hpux or hppa isGuido van Rossum2000-09-221-1/+1
| | | | unnecessary. Sez edg@SF
* Hopefully fix the problem with undeclared fdatasync() on HP-UX thatGuido van Rossum2000-09-221-0/+5
| | | | | | | was reported twice so far. Someone with access to HP-UX, please test this! (Is '__hppa' or 'hppa' really the correct symbol to test for?)
* Implemented new os.startfile function, unique to Windows, exposing aTim Peters2000-09-221-0/+33
| | | | | | | | | | | | | | | | subset of Win32 ShellExecute's functionality. Guido wants this because IDLE's Help -> Docs function currently crashes his machine because of a conflict between his version of Norton AntiVirus (6.10.20) and MS's _popen. Docs for startfile are being mailed to Fred (or just read the docstring -- it tells the whole story). Changed webbrowser.py to use os.startfile instead of os.popen on Windows. Changed IDLE's EditorWindow.py to pass an absolute path for the docs (hardcoding ShellExecute's "directory" arg to "." as used to be done let IDLE work, but made the startfile command exceedingly obscure for other uses -- the MS docs are terrible, of course, & still not sure I understand it). Note that Windows Python must link with shell32.lib now! That's where ShellExecute lives.
* Closes SF bug 113894: on Windows, things like os.listdir("k:") andTim Peters2000-09-151-9/+7
| | | | | | glob.glob("k:*py") (i.e., a raw drive letter + colon at the start) were using the root of the drive rather than the expected Windows behavior of using the drive's "current directory".
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.