summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis2002-01-1218-66/+0
|
* Fixed "u#" parser marker to pass through Unicode objects as-is withoutMarc-André Lemburg2002-01-091-0/+50
| | | | | | going through the buffer interface API. Added tests for this to the _testcapi module and updated docs.
* Patch #497126: Always compile dl.Martin v. Löwis2002-01-011-7/+7
|
* Add fcntl.h constants from glibc 2.2.4. Fixes #496171.Martin v. Löwis2001-12-281-0/+70
|
* Due to a cut-and-paste error, the type object exported under the nameGuido van Rossum2001-12-271-1/+1
| | | | | | statvfs_result was in fact the stat_result type object. :-( 2.2.1 bugfix!
* Add TCP socket options from glibc 2.2.4. Fixes #495680.Martin v. Löwis2001-12-221-0/+31
| | | | 2.2.1 bugfix candidate.
* Merge of the release22 branch changes back into the trunk.Barry Warsaw2001-12-211-3/+5
|
* 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().
* save(): Fix for SF bug #494904: Cannot pickle a class with aGuido van Rossum2001-12-191-0/+5
| | | | | | | | | | | | metaclass, reported by Dan Parisien. Objects that are instances of custom metaclasses, i.e. whose ob_type is a subclass of PyType_Type, should be pickled the same as new-style classes (objects whose ob_type is PyType_Type). This can't be done through the existing dispatch switches, and the __reduce__ trick doesn't work for these, since it finds the unbound __reduce__ for instances of the class (inherited from PyBaseObject_Type). So check explicitly using PyType_IsSubtype().
* SF bug #494738: binascii_b2a_base64 overwrites memory.Tim Peters2001-12-191-3/+5
| | | | | | | | binascii_b2a_base64(): We didn't allocate enough buffer space for very short inputs (e.g., a 1-byte input can produce a 5-byte output, but we only allocated 2 bytes). I expect that malloc overheads absorbed the overrun in practice, but computing a correct upper bound is a very simple change.
* initxxsubtype(): Add a comment to make the magic clearer; I doubt it'sTim Peters2001-12-171-2/+4
| | | | obvious to anyone except PyType_Ready's author <0.9 wink>.
* Use PyType_Ready() for initialization of the ob_type field of ourGuido van Rossum2001-12-171-2/+4
| | | | types (the tp_base field must be initialized prior to that call).
* David Abrahams tried to compile this as a separate DLL under MSVC, andTim Peters2001-12-171-4/+21
| | | | | | | | | | | | | got a barrage of compile errors that didn't make sense to the C++ brain: MSVC does not allow C (but does allow C++) initializers to contain data addresses supplied by other DLLs. So changed the initializers here to use dummy nulls, and changed module init to plug in the foreign addresses at runtime (manually simulating what C++ does by magic). Tested on Windows, and Guido tested on Linux (thanks!). BTW, the *point* is that people are going to use this module as a template for writing their own subtypes, and it's unusual for extension authors to build their extensions into Python directly (separate DLLs are the norm on Windows); so it's better if we give them a template that works <wink>.
* Give xxsubtype a module docstring, so its oddball purpose is discoverableTim Peters2001-12-101-2/+8
| | | | | from a prompt without searching the source code (there was an SF bug report about this, already closed ... "479568 xxsubtype builtin").
* Mods by Tony Lownds (patch 490100, slightly massaged by me) to make TkinterJack Jansen2001-12-092-1/+74
| | | | | | | | | | | | | | work with Mac OS X Aqua-Tk, all nicely within ifdefs. The process is not for the faint of heart, though: you need to download and install the (alfa) Aqua-Tk, obtain a few needed X11 headers from somewhere else and then everything builds. To run scripts using Tkinter you must build with --enable-framework, build Python.app in Mac/OSX and run your Tkinter scripts with that. Then, about half the tests in Demo/tkinter work (or at least do something). Checking this in anyway because it shouldn't break anything, and newer versions of Aqua-Tk will streamline the process.
* bug #133283, #477728, #483789, #490573Fredrik Lundh2001-12-091-19/+11
| | | | | | | backed out of broken minimal repeat patch from July also fixed a couple of minor potential resource leaks in pattern_subx (Guido had already fixed the big one)
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-0834-44/+46
| | | | | | | | | | | | | 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 #489989 (Charles G Waldman) linuxaudiodev.c - fix initializationGuido van Rossum2001-12-081-9/+8
| | | | | | | | | | | | | | | | | | | | | The OSS Programmer's Reference (www.4front-tech.com) states: *Setting Sampling Parameters There are three parameters which affect the sound quality (and therefore memory and bandwidth requirements) of sampled audio data. These are: ** sample format (sometimes called number of bits) ** number of channels (mono or stereo), and ** sampling rate (speed) NOTE: It is important to always set these parameters in the above order. Setting sampling rate before the number of channels doesn't work with all devices.
* 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.
* O_cwrite(): rewrote for clarity, replacing all the (Oobject *)selfGuido van Rossum2001-12-071-16/+17
| | | | | | | | | | | casts with a variable oself that has the proper type. A smart compiler may put this thing into a register. (I'm not sure what good this does except satisfy my desire to understand this function; I got a report about an uninitialized read from Insure++ about this function and it hurt my eyes to even look at it. I gotta run away or I'll get tempted to reformat the entire file...)
* Fix for #489672 (Neil Norwitz): memory leak in test_sre.Guido van Rossum2001-12-071-1/+4
| | | | | | | | | (At least for the repeatable test case that Tim produced.) pattern_subx(): Add missing DECREF(filter) in both exit branches (normal and error return). Also fix a DECREF(args) that should certainly be a DECREF(match) -- because it's inside if (!args) and right after allocation of match.
* audioop_ratecv() again: settle for a sloppier upper bound that's lessTim Peters2001-12-071-34/+19
| | | | obnoxious to compute and easier to explain. No compromise on safety.
* Undefine addrinfo.h constants if the system header defined them.Martin v. Löwis2001-12-061-4/+35
| | | | Fixes #486099.
* Fix [ #489673 ] memory leak in test_symtable: Free the st_future slot.Jeremy Hylton2001-12-061-0/+1
| | | | | | | The st_future slot of the symtable is not freed by PySymtable_Free() because it is shared by the symtable and compiling structs in compiel.c. Since it is shared, it is explicitly deallocated when the compiling struct is freed.
* SF bug #488514: -Qnew needs workTim Peters2001-12-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Big Hammer to implement -Qnew as PEP 238 says it should work (a global option affecting all instances of "/"). pydebug.h, main.c, pythonrun.c: define a private _Py_QnewFlag flag, true iff -Qnew is passed on the command line. This should go away (as the comments say) when true division becomes The Rule. This is deliberately not exposed to runtime inspection or modification: it's a one-way one-shot switch to pretend you're using Python 3. ceval.c: when _Py_QnewFlag is set, treat BINARY_DIVIDE as BINARY_TRUE_DIVIDE. test_{descr, generators, zipfile}.py: fiddle so these pass under -Qnew too. This was just a matter of s!/!//! in test_generators and test_zipfile. test_descr was trickier, as testbinop() is passed assumptions that "/" is the same as calling a "__div__" method; put a temporary hack there to call "__truediv__" instead when the method name is "__div__" and 1/2 evaluates to 0.5. Three standard tests still fail under -Qnew (on Windows; somebody please try the Linux tests with -Qnew too! Linux runs a whole bunch of tests Windows doesn't): test_augassign test_class test_coercion I can't stay awake longer to stare at this (be my guest). Offhand cures weren't obvious, nor was it even obvious that cures are possible without major hackery. Question: when -Qnew is in effect, should calls to __div__ magically change into calls to __truediv__? See "major hackery" at tail end of last paragraph <wink>.
* audioop_ratecv(): I left a potentially unsafe multiply uncheckedTim Peters2001-12-051-15/+15
| | | | | yesterday -- repair that. Also renamed the silly size_times_nchannels to bytes_per_frame.
* Fix memory leak in the parser module: There were two leaks inFred Drake2001-12-051-5/+22
| | | | | | parser_tuple2st() and a failure to propogate an error in build_node_children() (masking yet another leak, of course!). This closes SF bug #485133 (confirmed by Insure++).
* SF bug 482574: audioop.ratecv crashes.Tim Peters2001-12-051-6/+62
| | | | | | | | | | | | Bugfix candidate. A numerically naive computation of output buffer size caused crashes and spurious MemoryErrors for reasonable arguments. audioop_ratecv(): Avoid spurious overflow by careful reworking of the buffer size computations, triggering MemoryError if and only if the final buffer size can't be represented in a C int (although PyString_FromStringAndSize may legitimately raise MemoryError even if it does fit in a C int). All reasonable arguments should work as intended now, and all unreasonable arguments should be cuaght.
* Make sure to propogate errors that arise when profiling data cannot beFred Drake2001-12-041-71/+112
| | | | | written to the log file, and turn off the profiler. This closes SF bug #483925.
* More sprintf -> PyOS_snprintf.Tim Peters2001-12-041-2/+3
|
* 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.
* Changed logic for finding python home in Mac OS X framework Pythons.Jack Jansen2001-12-021-47/+45
| | | | | | Now sys.executable points to the executable again, in stead of to the shared library. The latter is used only for locating the python home.
* Check for NULL return value of PyList_New (follow-up to patch #486743).Martin v. Löwis2001-12-021-0/+3
|
* Patch #481718: Time module doc string changes.Martin v. Löwis2001-12-021-2/+4
|
* Patch #486743: remove bad INCREF, propagate exception in append_objects.Martin v. Löwis2001-12-021-6/+11
|
* Remove INET6 define. Use ENABLE_IPV6 instead.Martin v. Löwis2001-12-023-33/+33
|
* unicodedata_decomposition(): sprintf -> PyOS_snprintf.Tim Peters2001-11-301-2/+4
|
* Use identity instead of equality when looking for referrers. Fixes #485781.Martin v. Löwis2001-11-291-3/+4
|
* More sprintf -> PyOS_snprintf.Tim Peters2001-11-284-7/+11
|
* Use PyOS_snprintf() instead of sprintf().Jeremy Hylton2001-11-281-4/+4
|
* Repair a botched PyOS_snprintf conversion.Tim Peters2001-11-281-1/+1
|
* sprintf -> PyOS_snprintf in some "obviously safe" cases.Tim Peters2001-11-2813-36/+50
| | | | | 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-283-4/+4
|
* Fix docstring typoAndrew M. Kuchling2001-11-281-1/+1
|
* Correct typo. Fixes #484611.Martin v. Löwis2001-11-241-1/+1
|
* Rename get_referents to get_referrers. Fixes #483815.Martin v. Löwis2001-11-241-12/+12
|
* Test for negative buffer sizes. Fixes #482871.Martin v. Löwis2001-11-191-0/+5
|
* assert.h was not always included by Python.h; make sure we import it forFred Drake2001-11-181-0/+3
| | | | older versions. (Thanks to Martijn Faassen.)
* A change to sync with pickle.py:Barry Warsaw2001-11-151-8/+0
| | | | | | | | | | find_class(): We no longer mask all exceptions[1] by transforming them into SystemError. The latter is definitely not the right thing to do, so we let any exceptions that occur in the PyObject_GetAttr() call to simply propagate up if they occur. [1] Note that pickle only masked ImportError, KeyError, and AttributeError, but cPickle masked all exceptions.
* CVS patch #477161: New "access" keyword for mmap, from Jay T Miller.Tim Peters2001-11-131-69/+166
| | | | | | | | | | This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here.