summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* The addition of rint() (by Peter Schneider-Kamp; I forgot to mentionGuido van Rossum2000-05-111-0/+4
| | | | | | that before) in the previous patch has one problem; rint() is not in the C math library on all platforms (e.g. not for VC++). Make it conditional on HAVE_RINT.
* Added math.rint() -- round according to current IEEE754 modeGuido van Rossum2000-05-111-0/+3
|
* M.-A. Lemburg <mal@lemburg.com>:Fred Drake2000-05-091-1/+4
| | | | | Fixed a bug due to a /* inside /*...*/. GCC doesn't like this and bombs.
* New version from Jim Fulton to fix a problem that Eric Raymond ranGuido van Rossum2000-05-091-6/+20
| | | | | | | | | | | | | | | | | | | | | | into. Jim writes: The core dump was due to a C decrement operation in a macro invocation in load_pop. (BAD) I fixed this by moving the decrement outside the macro call. I added a comment to load_pop and load_mark to document the fact that cPickle separates the unpickling stack into two separate stacks, one for objects and one for marks. I also moved some increments out of some macro calls (PyTuple_SET_ITEM and PyList_SET_ITEM). This wasn't necessary, but made me feel better. :) I tested these changes in *my* cPickle, which doesn't have the new Unicode stuff.
* Trent Mick:Guido van Rossum2000-05-081-4/+4
| | | | | | | | | | | | | 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.]
* When the UTF-8 conversion to Unicode fails, return an 8-bit stringGuido van Rossum2000-05-041-1/+5
| | | | | | | | | | 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.)
* Two changes to improve (I hope) Unicode support.Guido van Rossum2000-05-041-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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?
* Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum2000-05-0337-124/+138
| | | | | | | | | | 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.)
* Remove all references to stdwin.Guido van Rossum2000-05-031-21/+1
|
* >>Boing!<<Guido van Rossum2000-05-031-2664/+0
| | | | Finally, this long-obsolete module bites the dust.
* Vladimir Marangozov:Guido van Rossum2000-05-031-5/+5
| | | | | Change Py_Malloc/Realloc/Free calls to PyMem_Malloc/Realloc/Free + PyErr_Nomemory on error check. Py_Malloc c.s. are obsolete.
* Mark Hammond to the rescue:Guido van Rossum2000-05-031-3/+4
| | | | | | | | | | | | 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.
* Disable the ZEROTRAP code -- this turns a 0 byte into a 2 byte and IGuido van Rossum2000-05-021-1/+1
| | | | | don't think that's what we want. There was some brief discussion of this somewhere but I don't recall where.
* usage_mid: Remove the description of the -X flag; it's gone now.Barry Warsaw2000-05-021-5/+0
| | | | Py_Main(): Remove the 'X' case.
* Ignore a bunch of generated files.Barry Warsaw2000-05-021-0/+8
|
* Marc-Andre Lemburg:Guido van Rossum2000-05-011-1/+6
| | | | | | | Added -U command line option. With the option enabled the Python compiler interprets all "..." strings as u"..." (same with r"..." and ur"...").
* posix_utime(): Allow the second argument to be None, which invokes theBarry Warsaw2000-05-011-7/+23
| | | | | | 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.
* Marc-Andre Lemburg:Guido van Rossum2000-04-271-1/+3
| | | | Fixes a memory leak found by Fredrik Lundh.
* Jack Jansen:Guido van Rossum2000-04-261-0/+17
| | | | | | | | 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.
* Michael Hudson:Guido van Rossum2000-04-261-3/+16
| | | | | | | | | | | | 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.
* Fix typo in last patch -- the symbol's name is MSG_DONWAIT, notGuido van Rossum2000-04-251-1/+1
| | | | MSG_DONTWAIT. Reported by Fredrik Lundh.
* Patch by Charles G Waldman:Guido van Rossum2000-04-251-1/+4
| | | | | 1) Adds MSG_DONTWAIT if defined (I needed this) 2) Spells "coreectly" correctly ;-)
* Charles G Waldman: Doing a PyObject_New then PyMem_DEL causes havoc ifGuido van Rossum2000-04-251-3/+3
| | | | you are trying to use Py_TRACE_REFS.
* validate_arglist(): Re-written to reflect extended call syntax.Fred Drake2000-04-251-3/+80
| | | | | validate_numnodes(): Added comment to explain the sometimes idiomatic usage pattern.
* Jack Jansen: The GUSI 2.0 I/O library used on the Mac uses theGuido van Rossum2000-04-241-9/+15
| | | | | | | | | | 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.]
* Charles Waldman writes:Guido van Rossum2000-04-211-14/+11
| | | | | | | | | | | | | | | | | | | | """ 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. """
* Use an explicit macro SOCKETCLOSE which expands to closesocket (onGuido van Rossum2000-04-211-10/+14
| | | | | | | | | 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.)
* Patch by Brian Hooper, somewhat augmented by GvR, to strip a trailingGuido van Rossum2000-04-211-0/+28
| | | | | | | | | | 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!)
* ANSI-fy & de-tabify the source.Fred Drake2000-04-191-1505/+1317
| | | | (4-space indents already used.)
* setup_confname_table(): Close memory leak caused by not decref'ing theBarry Warsaw2000-04-131-16/+15
| | | | inserted dictionary values. Also, simplified the logic a bit.
* raise TypeError when bad argument passed to cStringIO.StringIOJeremy Hylton2000-04-121-4/+10
|
* Correct fix by Mark Favas for the cast problems.Guido van Rossum2000-04-101-4/+5
|
* I've had complaints about the comparison "where >= 0" before -- onGuido van Rossum2000-04-101-1/+1
| | | | IRIX, it doesn't even compile. Added a cast: "where >= (char *)0".
* Remove CRLF line endings.Guido van Rossum2000-04-101-2/+2
| | | | Fredrik Lundh: add two missing casts.
* Skip Montanaro: add string precisions to calls to PyErr_FormatGuido van Rossum2000-04-101-1/+1
| | | | to prevent possible buffer overruns.
* In dealloc(), only close the socket if fd != -1.Guido van Rossum2000-04-101-1/+2
|
* Windows: Since we're not using ZLIB.DLL any more, don't define ZLIB_DLL.Guido van Rossum2000-04-061-3/+0
| | | | (Mark Hammond.)
* Mark Hammond <mhammond@skippinet.com.au>:Fred Drake2000-04-051-6/+2
| | | | This patch fixes the mmap module on Windows 9x.
* Patch from Hrvoje Niksic <hniksic@iskon.hr>:Fred Drake2000-04-041-8/+8
| | | | | | | | | | | | | | 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.
* Add warning that multi-arg connect() etc. are deprecated.Guido van Rossum2000-04-041-1/+1
|
* Put back multi-arg capability on connect/connect_ex/bind, forGuido van Rossum2000-04-041-21/+15
| | | | backwards compatibility, and to avoid a revolution.
* Marc-Andre Lemburg: The large unicode database table is broken inGuido van Rossum2000-03-313-10/+118
| | | | | pages of 4k entries each. This should fix compiler problems on some platforms.
* Add '#include <netinet/tcp.h>'Andrew M. Kuchling2000-03-311-0/+1
| | | | | | "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).
* This module's name should be linuxaudio*dev*.cGuido van Rossum2000-03-312-2/+1
|
* Added some clarifications to pyexpat.Guido van Rossum2000-03-311-0/+13
|
* Make it compile on Windows.Guido van Rossum2000-03-311-2/+4
|
* Added Python interface to Expat XML parser.Andrew M. Kuchling2000-03-312-0/+872
| | | | | | | | 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.
* Removed three unused variables from the Windows code.Guido van Rossum2000-03-311-3/+0
|
* Added the _sre module. It is always on.Guido van Rossum2000-03-311-0/+1
|
* Adding Fredrik Lundh's _sre.c module and its header files.Guido van Rossum2000-03-313-0/+1518
| | | | NOTE: THIS IS VERY ROUGH ALPHA CODE!