Commit graph

2522 commits

Author SHA1 Message Date
Martin v. Löwis
06a83e90aa Patch #543447: Add posix.mknod. 2002-04-14 10:19:44 +00:00
Fred Drake
88c9344986 initpwd(): Clean up initialization, avoid PyModule_GetDict(). 2002-04-13 21:07:45 +00:00
Tim Peters
af3e8de580 First stab at rationalizing the PyMem_ API. Mixing PyObject_xyz with
PyMem_{Del, DEL} doesn't work yet (compilation problems).

pyport.h:  _PyMem_EXTRA is gone.

pmem.h:  Repaired comments.  PyMem_{Malloc, MALLOC} and
PyMem_{Realloc, REALLOC} now make the same x-platform guarantees when
asking for 0 bytes, and when passing a NULL pointer to the latter.

object.c:  PyMem_{Malloc, Realloc} just call their macro versions
now, since the latter take care of the x-platform 0 and NULL stuff
by themselves now.

pypcre.c, grow_stack():  So sue me.  On two lines, this called
PyMem_RESIZE to grow a "const" area.  It's not legit to realloc a
const area, so the compiler warned given the new expansion of
PyMem_RESIZE.  It would have gotten the same warning before if it
had used PyMem_Resize() instead; the older macro version, but not the
function version, silently cast away the constness.  IMO that was a wrong
thing to do, and the docs say the macro versions of PyMem_xyz are
deprecated anyway.  If somebody else is resizing const areas with the
macro spelling, they'll get a warning when they recompile now too.
2002-04-12 07:22:56 +00:00
Neil Schemenauer
aa769ae468 PyObject_Del can now be used as a function designator. 2002-04-12 02:44:10 +00:00
Neil Schemenauer
fec4eb1be1 Allow PyObject_Del to be used as a function designator. Provide binary
compatibility function.

Make PyObject_GC_Track and PyObject_GC_UnTrack functions instead of
trivial macros wrapping functions.  Provide binary compatibility
functions.
2002-04-12 02:41:03 +00:00
Jack Jansen
8ab04b4d65 Got rid of ifdefs for long-obsolete GUSI versions. 2002-04-11 20:46:23 +00:00
Thomas Heller
1630520e5c Fix an obvious bug. 2002-04-09 12:50:13 +00:00
Martin v. Löwis
688357e035 Patch #512005: getrusage() returns struct-like object. 2002-04-08 21:28:20 +00:00
Guido van Rossum
8fdc75ba5e Lock methods acquire() and locked() now return bools. 2002-04-07 06:32:21 +00:00
Guido van Rossum
e276339cea Implement an idea by Paul Rubin:
Change pickling format for bools to use a backwards compatible
encoding.  This means you can pickle True or False on Python 2.3
and Python 2.2 or before will read it back as 1 or 0.  The code
used for pickling bools before would create pickles that could
not be read in previous Python versions.
2002-04-05 19:30:08 +00:00
Tim Peters
bc0e910826 Convert a pile of obvious "yes/no" functions to return bool. 2002-04-04 22:55:58 +00:00
Guido van Rossum
2e1c09c1fd Removed old Digital Creations copyright/license notices (with
permission from Paul Everitt).  Also removed a few other references to
Digital Creations and changed the remaining ones to Zope Corporation.
2002-04-04 17:52:50 +00:00
Guido van Rossum
77f6a65eb0 Add the 'bool' type and its values 'False' and 'True', as described in
PEP 285.  Everything described in the PEP is here, and there is even
some documentation.  I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison.  I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.

Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.
2002-04-03 22:41:51 +00:00
Fred Drake
a2bd8d3816 Remove direct manipulation of the module dict. 2002-04-03 21:39:26 +00:00
Mark Hammond
e7fefbf68d Fix bugs:
457466: popenx() argument mangling hangs python
 226766: popen('python -c"...."') tends to hang

Fixes argument quoting in w9xpopen.exe for Windows 9x.  w9xpopen.exe
also never attempts to display a MessageBox when not executed
interactively.

Added test_popen() test.  This test currently just executes
"python -c ..." as a child process, and checks that the expected
arguments were all recieved correctly by the child process.  This
test succeeds for me on Win9x, win2k and Linux, and I hope it does
for other popen supported platforms too :)
2002-04-03 01:47:00 +00:00
Neal Norwitz
b0aaec5706 Convert more METH_OLDARGS & PyArg_Parse()
Please review.
2002-04-02 18:26:33 +00:00
Neal Norwitz
187ae56166 Get rid of more PyArg_Parse & METH_OLDARGS.
PyArg_Parse( "s" )  -> PyString_AsString
  PyArg_Parse( "t#" ) -> PyString_AsStringAndSize
2002-04-02 18:17:57 +00:00
Martin v. Löwis
2f6ef4c630 Reindent. Break long lines. Move comments before the statements. 2002-04-01 17:40:08 +00:00
Fred Drake
4baedc1d9b Use the PyModule_Add*() APIs instead of manipulating the module dict
directly.
2002-04-01 14:53:37 +00:00
Fred Drake
9bb7432114 Remove all but one use of the module dict. 2002-04-01 14:49:59 +00:00
Fred Drake
d63e504d33 Remove unused variable and call to PyModule_GetDict(). 2002-04-01 14:30:50 +00:00
Fred Drake
acee69faf8 Switch to using METH_NOARGS where possible.
Convert to use PyModule_*() instead of manipulating the module dict directly.
2002-04-01 14:28:58 +00:00
Martin v. Löwis
43c9d8ad23 Remove UNLESS. 2002-04-01 12:34:33 +00:00
Fred Drake
f4e3484692 Use the PyModule_*() API instead of manipulating the module dictionary
directly.
2002-04-01 03:45:06 +00:00
Neal Norwitz
02098fa56b Get rid of all METH_OLDARGS & PyArg_Parse.
Fix floating point exception if mpz.powm(10, 1, 0) (modulus == 0).
Add a test.
2002-04-01 01:37:14 +00:00
Neal Norwitz
dfd59e039a mpz_float() only takes one parameter now 2002-03-31 22:02:37 +00:00
Neal Norwitz
767f83539d Get rid of warnings due to changing to METH_NOARGS 2002-03-31 16:13:39 +00:00
Neal Norwitz
28faa1bf28 Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Use METH_OLDARGS explicitly rather than implicitly.
2002-03-31 15:56:56 +00:00
Neal Norwitz
bb2769f580 Revert use of METH_OLDARGS (use 0) to support 1.5.2 2002-03-31 15:46:00 +00:00
Neal Norwitz
b82d34f91e Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple
Please review for correctness.
2002-03-31 15:43:28 +00:00
Neal Norwitz
ba3a16c6c3 Remove METH_OLDARGS:
Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple
  Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Please review.  All tests pass, but some modules don't have tests.
I spot checked various functions to try to make sure nothing broke.
2002-03-31 15:27:00 +00:00
Neal Norwitz
50905b557b Convert from using METH_OLDARGS to METH_NOARGS.
These should be safe.
2002-03-31 14:57:24 +00:00
Neal Norwitz
01b2694acb Fix whitespace 2002-03-31 14:55:17 +00:00
Neal Norwitz
b049325e92 Use symbolic METH_VARARGS/METH_OLDARGS instead of 1/0 for ml_flags 2002-03-31 14:44:22 +00:00
Neil Schemenauer
cc07ec17a3 Add missing typecast. 2002-03-29 19:58:25 +00:00
Andrew M. Kuchling
f4a4fb9a11 [Patch #536769] Add -Xcompiler flag for adding arguments and switches for
the compiler
2002-03-29 18:00:19 +00:00
Neil Schemenauer
b883310d59 Make _PyObject_GC_UnTrack do nothing if WITH_CYCLE_GC is not defined. 2002-03-29 03:04:25 +00:00
Neil Schemenauer
78662cf9a1 Add type cast. 2002-03-28 21:04:14 +00:00
Guido van Rossum
ff413af605 This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).
The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.

BUGFIX CANDIDATE!
2002-03-28 20:34:59 +00:00
Fred Drake
f841aa6fc0 Add a simple test of the METH_CLASS and METH_STATIC flags for type methods. 2002-03-28 15:49:54 +00:00
Martin v. Löwis
2e64c34850 Expose C library's gettext. Fixes #516412. 2002-03-27 18:49:02 +00:00
Martin v. Löwis
496f9e41ef Don't imply XPG4 constants from CODESET presence. Fixes #534153.
2.2.2 candiate.
2002-03-27 12:15:57 +00:00
Neal Norwitz
4632117e37 Missed change METH_OLDARGS to METH_NOARGS for two aliased functions 2002-03-26 14:52:00 +00:00
Neal Norwitz
7e78acbb1b Remove last occurrance of PyArg_GetInt. It is deprecated, 2002-03-25 22:23:53 +00:00
Neal Norwitz
2358425146 Missed change METH_OLDARGS to METH_NOARGS for two aliased functions 2002-03-25 21:05:50 +00:00
Neal Norwitz
3a6f97850b Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS. 2002-03-25 20:46:46 +00:00
Jack Jansen
6d8898b5eb Due to interaction between the MSL C library and the GUSI I/O library I can get reads from sockets to work consistently either for unbuffered binary files or for buffered binary files, but not for both:-(
The workaround is to force socket.makefile() to disable buffering for binary files.

Fixes bug 534625. 2.2.1 candidate.
2002-03-25 15:32:01 +00:00
Neil Schemenauer
29ac3cb7ed Expose RLIM_INFINITY constant. Closes SF patch 489066. 2002-03-24 22:27:39 +00:00
Neil Schemenauer
0f75e0dcad Add get_history_item, get_current_history_length, and redisplay functions.
Clarify the docstring for get_history_length.  Closes SF patch 494066.
2002-03-24 01:09:04 +00:00
Neil Schemenauer
fa79c65235 Match behavior of the pickle.py module more closely. 2002-03-22 23:02:53 +00:00