Commit Graph

1512 Commits

Author SHA1 Message Date
Guido van Rossum c554505ca1 Trent Mick:
Fix overflow bug in ldexp(x, exp). The 'exp' argument maps to a C int for the
math library call [double ldexp(double, int)], however the 'd'
PyArg_ParseTuple formatter was used to yield a double, which was subsequently
cast to an int. This could overflow.

[GvR: mysteriously, on Solaris 2.7, ldexp(1, 2147483647) returns Inf
while ldexp(1, 2147483646) raises OverflowError; this seems a bug in
the math library (it also takes a real long time to compute the
Inf outcome).  Does this point to a bug in the CHECK() macro?  It
should have discovered that the result was outside the HUGE_VAL range.]
2000-05-08 14:29:38 +00:00
Guido van Rossum 69529ad0cc When the UTF-8 conversion to Unicode fails, return an 8-bit string
instead.  This seems more robust than returning an Unicode string with
some unconverted charcters in it.

This still doesn't support getting truly binary data out of Tcl, since
we look for the trailing null byte; but the old (pre-Unicode) code did
this too, so apparently there's no need.  (Plus, I really don't feel
like finding out how Tcl deals with this in each version.)
2000-05-04 15:55:17 +00:00
Guido van Rossum 990f5c6c98 Two changes to improve (I hope) Unicode support.
1. In Tcl 8.2 and later, use Tcl_NewUnicodeObj() when passing a Python
Unicode object rather than going through UTF-8.  (This function
doesn't exist in Tcl 8.1, so there the original UTF-8 code is still
used; in Tcl 8.0 there is no support for Unicode.)  This assumes that
Tcl_UniChar is the same thing as Py_UNICODE; a run-time error is
issued if this is not the case.

2. In Tcl 8.1 and later (i.e., whenever Tcl supports Unicode), when a
string returned from Tcl contains bytes with the top bit set, we
assume it is encoded in UTF-8, and decode it into a Unicode string
object.

Notes:

- Passing Unicode strings to Tcl 8.0 does not do the right thing; this
isn't worth fixing.

- When passing an 8-bit string to Tcl 8.1 or later that has bytes with
the top bit set, Tcl tries to interpret it as UTF-8; it seems to fall
back on Latin-1 for non-UTF-8 bytes.  I'm not sure what to do about
this besides telling the user to disambiguate such strings by
converting them to Unicode (forcing the user to be explicit about the
encoding).

- Obviously it won't be possible to get binary data out of Tk this
way.  Do we need that ability?  How to do it?
2000-05-04 15:07:16 +00:00
Guido van Rossum b18618dab7 Vladimir Marangozov's long-awaited malloc restructuring.
For more comments, read the patches@python.org archives.
For documentation read the comments in mymalloc.h and objimpl.h.

(This is not exactly what Vladimir posted to the patches list; I've
made a few changes, and Vladimir sent me a fix in private email for a
problem that only occurs in debug mode.  I'm also holding back on his
change to main.c, which seems unnecessary to me.)
2000-05-03 23:44:39 +00:00
Guido van Rossum 2808b744e8 Remove all references to stdwin. 2000-05-03 22:34:12 +00:00
Guido van Rossum 31c9a27c12 >>Boing!<<
Finally, this long-obsolete module bites the dust.
2000-05-03 22:33:14 +00:00
Guido van Rossum 98e189dab4 Vladimir Marangozov:
Change Py_Malloc/Realloc/Free calls to PyMem_Malloc/Realloc/Free +
PyErr_Nomemory on error check.  Py_Malloc c.s. are obsolete.
2000-05-03 22:30:13 +00:00
Guido van Rossum 19dde103a8 Mark Hammond to the rescue:
Checkin 2.131 of posixmodule.c changed os.stat on Windows, so that
"/bin/" type notation (trailing backslash) would work on Windows to
be consistent with Unix.

However, the patch broke the simple case of: os.stat("\\")

This did work in 1.5.2, and obviously should!

This patch addresses this, and restores the correct behaviour.
2000-05-03 02:44:55 +00:00
Guido van Rossum 7d64b48eaf Disable the ZEROTRAP code -- this turns a 0 byte into a 2 byte and I
don't think that's what we want.  There was some brief discussion
of this somewhere but I don't recall where.
2000-05-02 21:18:13 +00:00
Barry Warsaw 57e11ae847 usage_mid: Remove the description of the -X flag; it's gone now.
Py_Main(): Remove the 'X' case.
2000-05-02 19:20:26 +00:00
Barry Warsaw ee98e4e75d Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
Guido van Rossum c15a9a1f98 Marc-Andre Lemburg:
Added -U command line option.

With the option enabled the Python compiler interprets all "..."
strings as u"..." (same with r"..." and ur"...").
2000-05-01 17:54:33 +00:00
Barry Warsaw 3cef856dd9 posix_utime(): Allow the second argument to be None, which invokes the
utime(path, NULL) call, setting the atime and mtime of the file to the
current time.  The previous signature utime(path, (atime, mtime)) is
of course still allowed.
2000-05-01 16:17:24 +00:00
Guido van Rossum 8823accd1f Marc-Andre Lemburg:
Fixes a memory leak found by Fredrik Lundh.
2000-04-27 20:14:31 +00:00
Guido van Rossum c410e92974 Jack Jansen:
This patch is a workaround for Macintosh, where the GUSI I/O library
(time, stat, etc) use the MacOS epoch of 1-Jan-1904 and the MSL C
library (ctime, localtime, etc) uses the (apparently ANSI standard)
epoch of 1-Jan-1900. Python programs see the MacOS epoch and we
convert values when needed.
2000-04-26 20:40:13 +00:00
Guido van Rossum 50422b403c Michael Hudson:
This patch changes posixmodule.c:execv to

a) check for zero length args (does this to execve, too), raising
   ValueError.

b) raises more rational exceptions for various flavours of duff arguments.
   I *hate*
      TypeError: "illegal argument type for built-in operation"
   It has to be one of the most frustrating error messages ever.
2000-04-26 20:34:28 +00:00
Guido van Rossum 14f3f59d2b Fix typo in last patch -- the symbol's name is MSG_DONWAIT, not
MSG_DONTWAIT.  Reported by Fredrik Lundh.
2000-04-25 21:53:58 +00:00
Guido van Rossum 2c8bcb8794 Patch by Charles G Waldman:
1)  Adds MSG_DONTWAIT if defined (I needed this)
2)  Spells "coreectly" correctly ;-)
2000-04-25 21:34:53 +00:00
Guido van Rossum c4428c58bb Charles G Waldman: Doing a PyObject_New then PyMem_DEL causes havoc if
you are trying to use Py_TRACE_REFS.
2000-04-25 15:59:32 +00:00
Fred Drake e7ab64e070 validate_arglist(): Re-written to reflect extended call syntax.
validate_numnodes():  Added comment to explain the sometimes idiomatic
        usage pattern.
2000-04-25 04:14:46 +00:00
Guido van Rossum ff3ab42c04 Jack Jansen: The GUSI 2.0 I/O library used on the Mac uses the
socklen_t (unsigned int) for most size parameters.  Apparently this is
part of the UNIX 98 standard.

[GvR: the changes to configure.in etc. that I just checked in make
sure that socklen_t is defined everywhere, so I deleted the little
part of Jack's mod to define socklen_t if not in GUSI2.  I suppose I
will have to add it to the Windows config.h in a minute.]
2000-04-24 15:16:03 +00:00
Guido van Rossum 83addc7a0f Charles Waldman writes:
"""
Problem description:

	Run the following script:

import test.test_cpickle
for x in xrange(1000000):
    reload(test.test_cpickle)

Watch Python's memory use go up up and away!

In the course of debugging this I also saw that cPickle is
inconsistent with pickle - if you attempt a pickle.load or pickle.dump
on a closed file, you get a ValueError, whereas the corresponding
cPickle operations give an IOError.  Since cPickle is advertised as
being compatible with pickle, I changed these exceptions to match.
"""
2000-04-21 20:49:36 +00:00
Guido van Rossum 2dd8dddef4 Use an explicit macro SOCKETCLOSE which expands to closesocket (on
Windows), soclose (on OS2), or to close (everywhere else).

Hopefully this fixes a new compilation error that I suddenly get on
Windows because the macro definition for close -> closesocket
apparently was done before including io.h, which contains a prototype
for close.  (No idea why this wasn't an error before.)
2000-04-21 20:33:00 +00:00
Guido van Rossum ace88aebbb Patch by Brian Hooper, somewhat augmented by GvR, to strip a trailing
backslash from the pathname argument to stat() on Windows -- while on
Unix, stat("/bin/") succeeds and does the same thing as stat("/bin"),
on Windows, stat("\\windows\\") fails while stat("\\windows") succeeds.
This modified version of the patch recognizes both / and \.

(This is odd behavior of the MS C library, since
os.listdir("\\windows\\") succeeds!)
2000-04-21 18:54:45 +00:00
Fred Drake ff9ea480eb ANSI-fy & de-tabify the source.
(4-space indents already used.)
2000-04-19 13:54:15 +00:00
Barry Warsaw 3155db3b79 setup_confname_table(): Close memory leak caused by not decref'ing the
inserted dictionary values.  Also, simplified the logic a bit.
2000-04-13 15:20:40 +00:00
Jeremy Hylton 127b2ef2d5 raise TypeError when bad argument passed to cStringIO.StringIO 2000-04-12 22:04:01 +00:00
Guido van Rossum 36d4f8b0ec Correct fix by Mark Favas for the cast problems. 2000-04-10 21:34:37 +00:00
Guido van Rossum e110dcfa86 I've had complaints about the comparison "where >= 0" before -- on
IRIX, it doesn't even compile.  Added a cast: "where >= (char *)0".
2000-04-10 21:14:05 +00:00
Guido van Rossum 29530886af Remove CRLF line endings.
Fredrik Lundh: add two missing casts.
2000-04-10 17:06:55 +00:00
Guido van Rossum 5db862dd0c Skip Montanaro: add string precisions to calls to PyErr_Format
to prevent possible buffer overruns.
2000-04-10 12:46:51 +00:00
Guido van Rossum fa972c987c In dealloc(), only close the socket if fd != -1. 2000-04-10 12:45:45 +00:00
Guido van Rossum 54b1c0b408 Windows: Since we're not using ZLIB.DLL any more, don't define ZLIB_DLL.
(Mark Hammond.)
2000-04-06 13:20:38 +00:00
Fred Drake 1ef4e2d54e Mark Hammond <mhammond@skippinet.com.au>:
This patch fixes the mmap module on Windows 9x.
2000-04-05 14:15:31 +00:00
Fred Drake 56a87a0905 Patch from Hrvoje Niksic <hniksic@iskon.hr>:
The bug is in mmap_read_line_method(), and its loop that searches for
newlines.  After the loop reaches EOF, eol is incremented and points
after the end of the memory.  This results in readline() method
sometimes picking up and returning a byte after the end of the string.
This is usually a bogus \0, but it could cause SIGSEGV if it's after
the end of the page).

The patch fixes the problem.  Also, it uses memchr() for finding a
character, which is in fact the "strnchr" the comment is asking for.
memchr() is already used in Python sources, so there should be no
portability problems.
2000-04-04 18:17:35 +00:00
Guido van Rossum b49dc75f51 Add warning that multi-arg connect() etc. are deprecated. 2000-04-04 15:09:07 +00:00
Guido van Rossum 527c9bd32a Put back multi-arg capability on connect/connect_ex/bind, for
backwards compatibility, and to avoid a revolution.
2000-04-04 14:10:20 +00:00
Guido van Rossum 8a16054240 Marc-Andre Lemburg: The large unicode database table is broken in
pages of 4k entries each. This should fix compiler problems on some
platforms.
2000-03-31 17:26:12 +00:00
Andrew M. Kuchling 52a644cbda Add '#include <netinet/tcp.h>'
"man tcp" on Solaris says that TCP_NODELAY is defined in
netinet/tcp.h, and the Open Groups Unix98 spec agrees
(http://www.opengroup.org/onlinepubs/009619199/ninettcp.htm).
2000-03-31 17:24:30 +00:00
Guido van Rossum 8de16932d0 This module's name should be linuxaudio*dev*.c 2000-03-31 16:56:32 +00:00
Guido van Rossum d1bda0ce88 Added some clarifications to pyexpat. 2000-03-31 16:39:02 +00:00
Guido van Rossum 5961f5a06d Make it compile on Windows. 2000-03-31 16:18:11 +00:00
Andrew M. Kuchling b7f105371f Added Python interface to Expat XML parser.
The Setup.in entry is sort of a lie; it links with -lexpat, but
    Expat's Makefile doesn't actually build a libexpat.a.  I'll send
    Expat's author a patch to do that; if he doesn't accept it, this
    rule will have to list Expat's object files (ick!), or have a
    comment explaining how to build a .a file.
2000-03-31 15:43:31 +00:00
Guido van Rossum 325942adb4 Removed three unused variables from the Windows code. 2000-03-31 15:04:26 +00:00
Guido van Rossum e56793557c Added the _sre module. It is always on. 2000-03-31 15:01:27 +00:00
Guido van Rossum b700df9824 Adding Fredrik Lundh's _sre.c module and its header files.
NOTE: THIS IS VERY ROUGH ALPHA CODE!
2000-03-31 14:59:30 +00:00
Guido van Rossum 64231e5c39 Add back an obscure "feature" to the Obj version of Tkapp_Call(): a
None in an argument list *terminates* the argument list: further
arguments are *ignored*.  This isn't kosher, but too much code relies
on it, implicitly.  For example, IDLE was pretty broken.
2000-03-31 03:29:39 +00:00
Guido van Rossum ef40e77ac5 Sigh. On Windows, (mode_t)i fails. Assume that there's a prototype
in scope on systems where mode_t isn't the same size as int...
2000-03-31 01:26:23 +00:00
Guido van Rossum 09fdf07315 Hacked for Win32 by Mark Hammond.
Reformatted for 8-space tabs and fitted into 80-char lines by GvR.

Mark writes:

* the Win32 version now accepts the same args as the Unix version.
The win32 specific "tag" param is now optional.  The end result is
that the exact same test suite runs on Windows (definately a worthy
goal!).

* I changed the error object.  All occurences of the error, except
for 1, corresponds to an underlying OS error.  This one was changed
to a ValueError (a better error for that condition), and the module
error object is now simply EnvironmentError.  All win32 error
routines now call the new Windows specific error handler.
2000-03-31 01:17:07 +00:00
Guido van Rossum a1f0a8f4a4 Don't use the object call interface in Tk 8.0 -- the EvalObj* API
changed from 8.0 to 8.1 and I see no big reason to use objects in 8.0.
At least now it works again with all versions from 8.0 - 8.3.
2000-03-31 00:51:37 +00:00
Guido van Rossum 49679b40b9 Oops, the previous patch contained a bug in chmod. Fixed now. 2000-03-31 00:48:21 +00:00
Guido van Rossum ffd15f5255 Two robustness patches:
(1) In opendir(), don't call the lock-release macros; we're
manipulating list objects and that shouldn't be done in unlocked
state.

(2) Don't use posix_strint() for chmod() -- the mode_t arg might be a
64 bit int (reported by Nick Maclaren).
2000-03-31 00:47:28 +00:00
Guido van Rossum aaf0ab26ed Add linuxaudio module. 2000-03-30 23:27:44 +00:00
Guido van Rossum b130dc7419 Audio module for Linux, contributed by Peter Bosch.
Careful, this has had zero testing (except by Peter)!
2000-03-30 23:25:49 +00:00
Andrew M. Kuchling 1ed7d2d2b8 Added mmap module -- map a view of a file into memory on Win32 and Unix.
(Needs testing on Win32.)
2000-03-30 21:14:30 +00:00
Guido van Rossum 632de27021 The Tcl_Obj patch discussed on the patches list.
This was originally submitted by Martin von Loewis as part of his
Unicode patch; all I did was add special cases for Python int and
float objects and rearrange the object type tests somewhat to speed up
the common cases (string, int, float, tuple, unicode, object).
2000-03-29 00:19:50 +00:00
Guido van Rossum 24bdb0474f Marc-Andre Lemburg:
The attached patch set includes a workaround to get Python with
Unicode compile on BSDI 4.x (courtesy Thomas Wouters; the cause
is a bug in the BSDI wchar.h header file) and Python interfaces
for the MBCS codec donated by Mark Hammond.

Also included are some minor corrections w/r to the docs of
the new "es" and "es#" parser markers (use PyMem_Free() instead
of free(); thanks to Mark Hammond for finding these).

The unicodedata tests are now in a separate file
(test_unicodedata.py) to avoid problems if the module cannot
be found.
2000-03-28 20:29:59 +00:00
Guido van Rossum a80649b357 Patch by Neil Schemenauer to remove support for Tcl/Tk versions before
8.0.  There really is no excuse, and for who really still wants those,
they can go back to Python 1.5.2.
2000-03-28 20:07:05 +00:00
Guido van Rossum e187b0eb20 Add a call to Tcl_FindExecutable(). This was inspired by a patch by
Martin von Loewis (whose more elaborate patch to use objects is still
under review).
2000-03-27 21:46:29 +00:00
Guido van Rossum 27fc3c05e1 Fix all routines to use PyArg_ParseTuple(), and add ":name" to the
argument format strings.

THIS WILL PROBABLY BREAK LOTS OF CODE!!!

Also fixed a bogus string in an error message in getsockaddrlen().
2000-03-24 20:56:56 +00:00
Andrew M. Kuchling c24ca4b192 Fix probable bug; if errno == EINTR, floatsleep() doesn't break out of
a Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS block, but it
   calls Py_BLOCK_THREADS anyway. The change moves Py_BLOCK_THREADS
   to inside the if, so it's only executed when the function
   actually returns unexpectedly.
2000-03-24 20:35:20 +00:00
Barry Warsaw 51ac58039f On 17-Mar-2000, Marc-Andre Lemburg said:
Attached you find an update of the Unicode implementation.

    The patch is against the current CVS version. I would appreciate
    if someone with CVS checkin permissions could check the changes
    in.

    The patch contains all bugs and patches sent this week and also
    fixes a leak in the codecs code and a bug in the free list code
    for Unicode objects (which only shows up when compiling Python
    with Py_DEBUG; thanks to MarkH for spotting this one).
2000-03-20 16:36:48 +00:00
Jeremy Hylton 7ceab65468 Fix bogus error reporting on strptime: let PyArg_ParseTuple set exception.
Also, wrap long line.
2000-03-14 21:17:16 +00:00
Guido van Rossum e141fd84e9 Marc-Andre Lemburg: add new Unicode-related files. 2000-03-10 23:12:33 +00:00
Guido van Rossum c7de91bf9c Marc-Andre Lemburg: Add _codecs and unicodedata modules. 2000-03-10 23:12:08 +00:00
Guido van Rossum 5fccb7c58e Marc-Andre Lemburg: support pickling Unicode objects, both in text
mode ('V') and in binary mode ('X').
2000-03-10 23:11:40 +00:00
Guido van Rossum 2a70a3a8fc Module unicodedata -- Provides access to the Unicode 3.0 data base.
Written by Marc-Andre Lemburg.
2000-03-10 23:10:21 +00:00
Guido van Rossum e2d67f98d1 Internal module _codecs -- Provides access to the codec registry and
the builtin codecs.  Written by Marc-Andre Lemburg.
2000-03-10 23:09:23 +00:00
Guido van Rossum 5bfc2eb697 Marc-Andre-Lemburg: The Unicode Database. 2000-03-10 23:08:04 +00:00
Fred Drake e066134f48 Fixed inet_ntoa() docstring. 2000-03-07 14:05:16 +00:00
Greg Ward b48bc17d10 Second attempt to fix the ctermid_r/tmpnam_r warnings: define USE_CTERMID_R
and USE_TMPNAM_R at the top of the file and refer to them later; this
catches a second reference to 'tmpnam_r' that I didn't spot first time around.
2000-03-01 21:51:56 +00:00
Greg Ward 9217fcbb38 Fix compiler warning: only use "_r" form of 'ctermid()' and 'tmpnam()' when
building a threaded Python.
2000-03-01 18:59:47 +00:00
Guido van Rossum 61b705a570 Patch by Fred Gansevles (the module's original author).
This patch fixes 3 small problems.
1) If a map is used which is generated with 'makedbm -a',
   the trailing '\0' is now handled correctely.
2) The nis.maps() function skipped the first map in the output list.
3) The library '-lnsl' is added in Setup.in (needed on Linux glibc2 and
   Solaris systems. Maybe on other systems too?)

[I note that this still doesn't work when you are using NIS+ --GvR]
2000-02-29 15:52:40 +00:00
Guido van Rossum 43713e5a28 Massive patch by Skip Montanaro to add ":name" to as many
PyArg_ParseTuple() format string arguments as possible.
2000-02-29 13:59:29 +00:00
Andrew M. Kuchling b6f6e95ed2 Better fix for mpzmodule problem reported by Peter Funk: just use
mp_bits_per_limb with GMP 2.0
2000-02-25 22:23:31 +00:00
Guido van Rossum 4985e40939 Delete references to _SC_AIO_LIST_MAX; it appears that that symbol was
just a typo in some Linux header; the real symbol is
_SC_AIO_LISTIO_MAX.
2000-02-25 17:51:00 +00:00
Guido van Rossum e7ef74dbf8 Peter Funk:
This patch allows building the Python 'mpzmodule' under SuSE Linux
without having to install the source package of the GMP-libary.
The gmp-mparam.h seems to be an internal header file.  The patch
shouldn't hurt any other platforms.
2000-02-24 15:26:30 +00:00
Fred Drake 0dd7507e51 What used to be tp_xxx4 is now tp_flags; set it to Py_TPFLAGS_DEFAULT. 2000-02-21 18:19:06 +00:00
Andrew M. Kuchling fc9d2252af Patch from Vladimir Marangozov <marangoz@python.inrialpes.fr>
The same problem (mixed mallocs) exists for the pcre stack.
	The buffers md->... are allocated via PyMem_RESIZE in grow_stack(),
	while in free_stack() they are released with free() instead of
	PyMem_DEL().
2000-02-18 19:16:45 +00:00
Andrew M. Kuchling 0c7822e832 Patch from Vladimir Marangozov <marangoz@python.inrialpes.fr>:
The buffers self->regex and self->regex_extra are allocated in
	pcre_compile() and pcre_study() via pcre_malloc, but are released
	via free() instead of pcre_free.
2000-02-18 18:30:01 +00:00
Guido van Rossum 7d47c9e38a Patch by Jim Ahlstrom to add crc32, a useful checksum function
(e.g. used for ZIP files).

The patch includes code that says:
+  Copyright (C) 1986 Gary S. Brown.  You may use this program, or
+  code or tables extracted from it, as desired without restriction.

My interpretation (and Jim's) is that Gary S Brown has no claims under
copyright, patent or other rights or interests.  Lawyers might disagree.
2000-02-16 21:11:52 +00:00
Fred Drake da8d216eb2 Protect against core dumps in gdbm: don't allow access by key once the
database is closed.  Raise gdbm.error instead.

Bug report #198 submitted by Barry Haddow <bhaddow@orbism.com>.
2000-02-07 17:19:41 +00:00
Fred Drake 0d40ba4cdf Patch from Paul Sokolovsky <Paul.Sokolovsky@technologist.com>:
Attached is patch (against 1.5.2 release) to allow some modules
to be buildable as pyd's (usual &PyType_Type stuff).
2000-02-04 20:33:49 +00:00
Fred Drake a664dbbff8 Added docstring to crypt.crypt() based on the documentation. 2000-02-01 20:12:39 +00:00
Guido van Rossum b3d3956e01 The initialization of posix_putenv_garbage should only be done when it
is defined...
2000-01-31 18:41:26 +00:00
Guido van Rossum bffd683f73 The rest of the changes by Trent Mick and Dale Nagata for warning-free
compilation on NT Alpha.  Mostly added casts etc.
2000-01-20 22:32:56 +00:00
Guido van Rossum 947a0fa4f9 According to Ron Bickers, and with apparent approval of Chris
Herborth, the code in list2set() that sets max unconditionally to 0
should not be used on BeOS.  So be it.  Anybody using BeOS, please
test!
2000-01-14 16:33:09 +00:00
Guido van Rossum b2b42ddcb1 The functions asctime() and mktime() are documented to take a 9-tuple
only.  Through some mysterious interaction, they would take 9 separate
arguments as well.  This misfeature is now disabled (to end a
difference with JPython).
2000-01-12 16:38:20 +00:00
Fred Drake e1a79b9b42 setup_confname_table(): Use size_t instead of int for an index when
building the dicts used to inform the user about the defined
        constants when using the *conf*() APIs.

Thanks to Mark Hammond <mhammond@skippinet.com.au>.
1999-12-30 18:05:43 +00:00
Fred Drake 8972dfd58e For ZlibError and ZLIB_VERSION, only attempt to add entry to the
module dict if the inserted object isn't NULL (basic defensive
programming!).
1999-12-22 16:13:54 +00:00
Andrew M. Kuchling 313a3e36e7 Fix typo in docstring: wbites -> wbits 1999-12-20 22:13:38 +00:00
Guido van Rossum 4e08379891 Patch and new file by Geoff Furnish for C++ compilation. 1999-12-16 17:52:08 +00:00
Fred Drake bec628d4bc Rip out the code to check the ordering of the tables used to map
strings to integers for the *conf*() functions.

Added code to sort the tables at module initialization.  Three
dictionaries, confstr_names, sysconf_names, and pathconf_names, are
added to the module as well.  These map known configuration setting
names to the numeric value which is used to represent the setting in
the system call.  This code is always called.

Updated related comments.
1999-12-15 18:31:10 +00:00
Fred Drake d86ed29f44 Added table entries for Irix 6.5 names for confstr()/sysconf()/
pathconf() names, from Sjoerd.

Added code to verify that these tables are properly ordered, only
included and used when CHECK_CONFNAME_TABLES is defined.  This is only
needed to test the tables, so I haven't enabled this by default.
1999-12-15 15:34:33 +00:00
Fred Drake 12c6e2d497 Added support for getlogin(); does *not* use getlogin_r() where
available since the interface is poorly defined on at least one major
platform (Solaris).

Moved table of constant names for fpathconf() & pathconf() into the
conditional that defines the conv_path_confname() helper; Mark Hammond
reported that defining the table when none of the constants were
defined causes the compiler to complain (won't allow 0-length array,
imagine that!).

In posix_fpathconf(), use conv_path_confname() as the O& conversion
function, instead of the conv_confname() helper, which has the wrong
signature (posix_pathconf() already used the right thing).
1999-12-14 21:25:03 +00:00
Fred Drake 71f00fb6df Removed debugging prints. 1999-12-13 16:55:24 +00:00
Fred Drake c968092d5c Added bindings for getgroups(), fpathconf(), pathconf(), confstr(),
and sysconf().

*Lots* of tables to define names used by *conf*(); explanation to go
in message to python-dev list.
1999-12-13 16:37:25 +00:00
Guido van Rossum 09ac088152 The call to PyArg_ParseTuple in al_Connect had one too few arguments.
This fixes PR#157.
1999-12-10 15:12:11 +00:00
Fred Drake 5ab8eaf0bb Added support for abort(), ctermid(), tmpfile(), tempnam(), tmpnam(),
and TMP_MAX.

Converted all functions that used PyArg_Parse() or PyArg_NoArgs() to
use PyArg_ParseTuple() and specified all function names using the
:name syntax in the format strings, to allow better error messages
when TypeError is raised for parameter type mismatches.
1999-12-09 21:13:07 +00:00
Guido van Rossum cbdff766d2 OpenSSL support. This is based on patches for a version of SSLeay by
Brian E Gallew, which were improved and adapted to OpenSSL 0.9.4 by
Laszlo Kovacs of HP.  Both have kindly given permission to include
the patches in the Python distribution.  Final formatting by GvR.
1999-12-07 21:47:09 +00:00