Commit graph

453 commits

Author SHA1 Message Date
Tim Peters
11b2306960 Enable os.fsync() for Windows, mapping it to MS's _commit() there. The
docs here are best-guess:  the MS docs I could find weren't clear, and
some even claimed _commit() has no effect on Win32 systems (which is
easily shown to be false just by trying it).
2003-04-23 02:39:17 +00:00
Andrew MacIntyre
baf25b06a6 apply Mark Hammond's PEP 311 changes to the EMX ripoff of the Windows
popen[234]() code
2003-04-21 14:22:36 +00:00
Andrew MacIntyre
75e0145bb5 - DosSetExtLIBPATH objects to a NULL pointer, but a pointer to a NULL
string does what is expected (ie unset [BEGIN|END]LIBPATH)

- set the size of the DosQuerySysInfo buffer correctly; it was safe,
  but incorrect (allowing a 1 element overrun)
2003-04-21 14:19:51 +00:00
Mark Hammond
8d98d2cb95 New PyGILState_ API - implements pep 311, from patch 684256. 2003-04-19 15:41:53 +00:00
Martin v. Löwis
b9a0f91218 Rename LONG_LONG to PY_LONG_LONG. Fixes #710285. 2003-03-29 10:06:18 +00:00
Neal Norwitz
2deaddb0d6 Get rid of warning on IRIX 2003-03-21 03:08:31 +00:00
Neal Norwitz
b59798b157 Add support for os.openpty() on AIX which uses /dev/ptc instead of /dev/ptmx. 2003-03-21 01:43:31 +00:00
Martin v. Löwis
7a924e6eb2 Patch #696645: Remove VMS code with uncertain authorship. 2003-03-05 14:15:21 +00:00
Just van Rossum
6a42183967 os.listdir(): Fall back to the original byte string if conversion to unicode
fails, as discussed in patch #683592.
2003-03-04 19:30:44 +00:00
Just van Rossum
2fe07fda2d plugged leak noted by nnorwitz: the 'et' format returns allocated memory 2003-03-03 19:07:13 +00:00
Just van Rossum
96b1c903f5 Patch #683592 revisited, after discussions with MvL:
- Implement the behavior as specified in PEP 277, meaning os.listdir()
  will only return unicode strings if it is _called_ with a unicode
  argument.
- And then return only unicode, don't attempt to convert to ASCII.
- Don't switch on Py_FileSystemDefaultEncoding, but simply use the
  default encoding if Py_FileSystemDefaultEncoding is NULL. This means
  os.listdir() can now raise UnicodeDecodeError if the default encoding
  can't represent the directory entry. (This seems better than silcencing
  the error and fall back to a byte string.)
- Attempted to decribe the above in Doc/lib/libos.tex.
- Reworded the Misc/NEWS items to reflect the current situation.

This checkin also fixes bug #696261, which was due to os.listdir() not
using Py_FileSystemDefaultEncoding, like all file system calls are
supposed to.
2003-03-03 17:32:15 +00:00
Just van Rossum
46c9784f68 Patch #683592: unicode support for os.listdir()
os.listdir() may now return unicode strings on platforms that set
Py_FileSystemDefaultEncoding.
2003-02-25 21:42:15 +00:00
Mark Hammond
05107b6af7 os.mkdir() would crash with a Unicode filename and mode param. 2003-02-19 04:08:27 +00:00
Neal Norwitz
e241ce830a Added test_posix (hopefully it works on Windows).
Remove PyArg_ParseTuple() for methods which take no args,
use METH_NOARGS instead
2003-02-17 18:17:05 +00:00
Neal Norwitz
ec74f2fda7 Add more missing PyErr_NoMemory() after failled memory allocs 2003-02-11 23:05:40 +00:00
Neal Norwitz
4adc9abc32 Fix memory leak of newstr when putenv() fails 2003-02-10 03:10:43 +00:00
Neal Norwitz
8e914d9a1d Get rid of compiler warnings 2003-01-10 15:29:16 +00:00
Barry Warsaw
5676bd1c2d all_ins(): EX_OK and friends, constants from sysexits.h 2003-01-07 20:57:09 +00:00
Martin v. Löwis
14e73b1864 Expose I_ constants. Auto-detect stropts.h. Properly configure the slave terminal. 2003-01-01 09:51:12 +00:00
Neal Norwitz
6700e47b3c Fix compilation errors on HPUX11 2002-12-31 16:16:07 +00:00
Martin v. Löwis
c8b2e770cf Restore signalhandler in case of error. Fix type of signal handler. 2002-12-31 14:30:26 +00:00
Martin v. Löwis
24a880b499 Patch #656590: /dev/ptmx support for ptys. 2002-12-31 12:55:15 +00:00
Martin v. Löwis
438b534ad0 Patch #657889: Implement posix.getloadavg. 2002-12-27 10:16:42 +00:00
Guido van Rossum
0847c5c6c7 execve(), spawnve(): add some extra sanity checking to env;
PyMapping_Check() doesn't guarantee that PyMapping_Size() won't raise
an exception, nor that keys and values are lists.

Also folded some long lines and did a little whitespace normalization.

Probably a 2.2 backport candidate.
2002-12-13 18:36:22 +00:00
Martin v. Löwis
79acb9edfa Patch #614055: Support OpenVMS. 2002-12-06 12:48:53 +00:00
Martin v. Löwis
0073f2e428 Fix --disable-unicode compilation problems. 2002-11-21 23:52:35 +00:00
Walter Dörwald
3b918c3787 Comment out the getcwdu implementation for --disable-unicode builds 2002-11-21 20:18:46 +00:00
Thomas Heller
1f043e28f4 Enforce valid filemode. Fixes SF Bug #623464. 2002-11-07 16:00:59 +00:00
Martin v. Löwis
d631ebe20b Remove extra argument in mknod. Fixes #632628. 2002-11-02 17:42:33 +00:00
Martin v. Löwis
60a5d72908 Patch #623780: Replace obsolete struct macros. 2002-10-16 20:28:25 +00:00
Martin v. Löwis
f607bdaa77 Add PyStructSequence_UnnamedField. Add stat_float_times.
Use integers in stat tuple, optionally floats in named fields.
2002-10-16 18:27:39 +00:00
Guido van Rossum
1e700d24e9 posix_execve(): add missing argument for "et" format in PyArg_Parse()
call.  This caused mysterious crashes (hard to debug because it was
happening in a child process).
2002-10-16 16:52:11 +00:00
Neal Norwitz
c18b308229 Fix a few docstrings, remove extra commas 2002-10-11 22:19:42 +00:00
Martin v. Löwis
dbe3f76270 Patch #569139: Implementation of major, minor and makedev. 2002-10-10 14:27:30 +00:00
Martin v. Löwis
114619e1ed Apply file system default encoding to exec and spawn path and arguments. 2002-10-07 06:44:21 +00:00
Tim Peters
92e4dd8657 s/_alloca/alloca/g; Windows doesn't need the former, at least not unless
__STDC__ is defined (or something like that ...).
2002-10-05 01:47:34 +00:00
Mark Hammond
d389036069 Trivial fix to the pep277 checkin: ensure that exceptions always have a filename attribute (previously did only when string filenames were passed, but not when unicode) 2002-10-03 07:24:48 +00:00
Mark Hammond
c2e85bd4e2 Patch 594001: PEP 277 - Unicode file name support for Windows NT. 2002-10-03 05:10:39 +00:00
Martin v. Löwis
8eb92a014b Patch #608999: Fix portability problems with MIPSPro 7.x 2002-09-19 08:03:21 +00:00
Guido van Rossum
bd6be7aba5 I think it makes more sense that the pseudo filename used by fdopen()
be "<fdopen>" rather than "(fdopen)".
2002-09-15 18:45:46 +00:00
Tim Peters
96940cf30d extract_time(): Squash compiler warning about possibly information-
losing implicit double->long cast.
2002-09-10 15:37:28 +00:00
Martin v. Löwis
076b209ca4 Add missing return statement. 2002-09-10 15:04:41 +00:00
Martin v. Löwis
6aa9fdb86a Use utimes(2) where available to support microsecond timestamps. 2002-09-10 09:16:13 +00:00
Martin v. Löwis
a32c994129 Always generate floats for stat_result; fix configure test. 2002-09-09 16:17:47 +00:00
Martin v. Löwis
94717ed1d4 Patch #606592: Subsecond timestamps in stat_result. 2002-09-09 14:24:16 +00:00
Guido van Rossum
674deb2eea SF bug 601775 - some int results that should be bool. 2002-09-01 15:06:28 +00:00
Tim Peters
7dca21e59f SF bug 595919: popenN return only text mode pipes
popen2() and popen3() created text-mode pipes even when binary mode
was asked for.  This was specific to Windows.
2002-08-19 00:42:29 +00:00
Mark Hammond
fe51c6d66e Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
for Py_Main().

Thanks to Kalle Svensson and Skip Montanaro for the patches.
2002-08-02 02:27:13 +00:00
Jack Jansen
ea0c3828c0 - Get _environ through the NSEnviron call in a MacOSX framework. This allows
us to completely decouple the framework from the executable, so we
  can use a two-level namespace.
- Do framework builds with a twolevel namespace.
- Reorganized the code that creates the minimal framework in the build
  directory, to make it more robust against incomplete frameworks (from
  earlier aborted builds, or builds of previous Python versions).
2002-08-01 21:57:49 +00:00
Neal Norwitz
cfa1f52941 Revert changes to use PyArg_Parse(), so any sequence will continue to work -- Spotted by Just van Rossum 2002-07-30 12:27:43 +00:00