summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* ANSIfy as many declarations as possible.Thomas Wouters2000-07-225-7/+8
|
* Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters2000-07-2245-1526/+704
| | | | declarations yet, those come later.
* Fix two instances of empty argument lists, and fix styleThomas Wouters2000-07-221-79/+78
| | | | ('PyObject** x' -> 'PyObject **x')
* Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters2000-07-1610-11/+11
| | | | | | | | | | comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
* just fixing the indentationPeter Schneider-Kamp2000-07-131-1/+1
|
* raise error on duplicate function argumentsPeter Schneider-Kamp2000-07-131-1/+10
| | | | | | | | example: >>> def f(a,a):print a ... SyntaxError: duplicate argument in function definition
* delete obsolete SYMANTEC__CFM68K__ #ifdefsSkip Montanaro2000-07-122-8/+0
|
* replace PyXXX_Length calls with PyXXX_Size callsJeremy Hylton2000-07-123-10/+11
|
* Worm around MSVC6 error on single string literal > 2Kb.Tim Peters2000-07-121-2/+7
|
* Include macglue.h for some function prototypes, and renamed a fewJack Jansen2000-07-113-3/+10
| | | | mac-specific functions to have a PyMac_ name.
* Create two new exceptions: IndentationError and TabError. These areFred Drake2000-07-112-4/+42
| | | | | | | used for indentation related errors. This patch includes Ping's improvements for indentation-related error messages. Closes SourceForge patches #100734 and #100856.
* Exception__str__(): In case 1, be sure to decref the tmp localBarry Warsaw2000-07-091-4/+8
| | | | | variable. This crushes another memory leak. Slight rewrite included.
* EnvironmentError__init__(): The two case clauses were missingBarry Warsaw2000-07-091-3/+9
| | | | | | | | `break's. This first missing break caused a memory leak when case 3 fell through case 2 in the following example: import os os.chmod('/missing', 0600)
* Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.Tim Peters2000-07-0911-135/+126
|
* Get rid of unused vars in builtin_unicode (they were causingTim Peters2000-07-091-2/+0
| | | | legit warnings).
* Fixed unicode() to use the new API PyUnicode_FromEncodedObject().Marc-André Lemburg2000-07-071-14/+1
| | | | | | | This adds support for instance to the constructor (instances have to define __str__ and can return Unicode objects via that hook; string return values are decoded into Unicode using the current default encoding).
* Added support for H (unsigned short) specifier in PyArg_ParseTuple andJack Jansen2000-07-062-1/+30
| | | | Py_BuildValue.
* Include limits.h if we have it.Jack Jansen2000-07-034-0/+12
|
* init_exceptions(): Decref `doc' so it doesn't leak.Barry Warsaw2000-07-011-0/+1
|
* Jack Jansen, Mac patch:Guido van Rossum2000-07-011-0/+3
| | | | Include limits.h if we have it.
* Jack Jansen, Mac patch:Guido van Rossum2000-07-011-0/+6
| | | | If we have stat.h include it if we don't have sys/stat.h
* Jack Jansen, Mac patch:Guido van Rossum2000-07-011-2/+3
| | | | Include stat.h if needed; different Mac filename compare
* Change copyright notice - 2nd try.Guido van Rossum2000-06-3049-294/+0
|
* Change copyright notice.Guido van Rossum2000-06-3051-1112/+347
|
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-302-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes possible overflow in the use of PyOS_GetLastModificationTime in getmtime.c and Python/import.c. Currently PyOS_GetLastModificationTime returns a C long. This can overflow on Win64 where sizeof(time_t) > sizeof(long). Besides it should logically return a time_t anyway (this patch changes this). As well, import.c uses PyOS_GetLastModificationTime for .pyc timestamping. There has been recent discussion about the .pyc header format on python-dev. This patch adds oveflow checking to import.c so that an exception will be raised if the modification time overflows. There are a few other minor 64-bit readiness changes made to the module as well: - size_t instead of int or long for function-local buffer and string length variables - one buffer overflow check was added (raises an exception on possible overflow, this overflow chance exists on 32-bit platforms as well), no other possible buffer overflows existed (from my analysis anyway) Closes SourceForge patch #100509.
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-3011-110/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
* replace constant 1 with symbolic constant METH_VARARGSJeremy Hylton2000-06-301-9/+9
| | | | another typo caught by Rob Hooft
* another typo caught by Rob HooftJeremy Hylton2000-06-301-1/+1
|
* - workaround to make 1.6 build under MSVC 5.0. hopefully,Fredrik Lundh2000-06-291-0/+4
| | | | | trent (who broke it in the first place ;-) will come up with a cleaner solution.
* Change the loop index in normalizestring() to size_t too, to avoid aGuido van Rossum2000-06-291-1/+1
| | | | warning on Windows.
* Vladimir Marangozov:Guido van Rossum2000-06-281-8/+8
| | | | | | | | | | | | This patch fixes a problem on AIX with the signed int case code in getargs.c, after Trent Mick's intervention about MIN/MAX overflow checks. The AIX compiler/optimizer generates bogus code with the default flags "-g -O" causing test_builtin to fail: int("10", 16) <> 16L. Swapping the two checks in the signed int code makes the problem go away. Also, make the error messages fit in 80 char lines in the source.
* Urmpf. Quality control on this patch lapsed a bit. :-(Guido van Rossum2000-06-281-2/+6
| | | | | | | | | | | The depth field was never decremented inside w_object(), and it was never initialized in PyMarshal_WriteObjectToFile(). This caused imports from .pyc files to fil mysteriously when the .pyc file was written by the broken code -- w_object() would bail out early, but PyMarshal_WriteObjectToFile() doesn't check the error or return an error code, and apparently the marshalling code doesn't call PyErr_Check() either. (That's a separate patch if I feel like it.)
* Trent Mick's Win64 changes: size_t vs. int or long; also some overflowGuido van Rossum2000-06-289-21/+40
| | | | tests.
* Trent Mick:Guido van Rossum2000-06-281-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | Various small fixes to the builtin module to ensure no buffer overflows. - chunk #1: Proper casting to ensure no truncation, and hence no surprises, in the comparison. - chunk #2: The id() function guarantees a unique return value for different objects. It does this by returning the pointer to the object. By returning a PyInt, on Win64 (sizeof(long) < sizeof(void*)) the pointer is truncated and the guarantee may be proven false. The appropriate return function is PyLong_FromVoidPtr, this returns a PyLong if that is necessary to return the pointer without truncation. [GvR: note that this means that id() can now return a long on Win32 platforms. This *might* break some code...] - chunk #3: Ensure no overflow in raw_input(). Granted the user would have to pass in >2GB of data but it *is* a possible buffer overflow condition.
* Michael Hudson <mwh21@cam.ac.uk>:Fred Drake2000-06-281-3/+22
| | | | | | | | | | | | | As I really do not have anything better to do at the moment, I have written a patch to Python/marshal.c that prevents Python dumping core when trying to marshal stack bustingly deep (or recursive) data structure. It just throws an exception; even slightly clever handling of recursive data is what pickle is for... [Fred Drake:] Moved magic constant 5000 to a #define. This closes SourceForge patch #100645.
* Add new parser error code, E_OVERFLOW. This error is returned whenJeremy Hylton2000-06-201-0/+3
| | | | | | the number of children of a node exceeds the max possible value for the short that is used to count them. The Python runtime converts this parser error into the SyntaxError "expression too long."
* mark SyntaxError__str__ as METH_VARARGSJeremy Hylton2000-06-201-1/+1
|
* Added a new debug method sys.gettotalrefcount(), which returns the total ↵Mark Hammond2000-06-201-1/+14
| | | | | | number of references on all Python objects. This is only enabled when Py_TRACE_REFS is defined (which includes default debug builds under Windows). Also removed a redundant cast from sys.getrefcount(), as discussed on the patches list.
* Christopher Fandrich <cfandrich@8cs.com>:Fred Drake2000-06-201-3/+6
| | | | Fix memory leak in initializing __debug__.
* Marc-Andre Lemburg <mal@lemburg.com>:Marc-André Lemburg2000-06-071-10/+10
| | | | | | Changed the API names for setting the default encoding. These are now in line with the other hooks API names (no underscores).
* The standard exception classes. Moved here from ../Modules/_exceptions.cBarry Warsaw2000-05-261-0/+994
|
* Added exceptions.o to the list of object to build in this subdir.Barry Warsaw2000-05-261-1/+2
|
* All the exception building related stuff has been moved out of thisBarry Warsaw2000-05-251-190/+1
| | | | | | | | | | | | module and into _exceptions.c. This includes all the PyExc_* globals, the bltin_exc table, init_class_exc(), fini_instances(), finierrors(). Renamed _PyBuiltin_Init_1() to _PyBuiltin_Init() since the two phase initializations are necessary any more. Removed as obsolete _PyBuiltin_Init_2(), _PyBuiltin_Fini_1() and _PyBuiltin_Fini_2().
* Py_Initialize(): Now that standard exceptions are builtin, we don'tBarry Warsaw2000-05-251-11/+11
| | | | | | | | | | need two phase init or fini of the builtin module. Change the call of _PyBuiltin_Init_1() to _PyBuiltin_Init(). Add a call to init_exceptions(). Py_Finalize(): Don't call _PyBuiltin_Fini_1(). Instead call fini_exceptions() but move this to before the thread state is cleared.
* bltin_exc: Removed the leaf_exc flag in the structure, which was onlyBarry Warsaw2000-05-251-35/+29
| | | | used to build the fallback string-based exception.
* Bill Tutt:Guido van Rossum2000-05-111-1/+24
| | | | | Calling Sleep(0) for a spinlock can cause a priority inversion, adding comments to explain what's going on.
* At Bob Kahn's request, add CNRI to the copyright string (but not toGuido van Rossum2000-05-101-1/+5
| | | | the notice yet).
* Trent Mick <trentm@activestate.com>:Fred Drake2000-05-091-12/+12
| | | | | | Limit the 'b' formatter of PyArg_ParseTuple to valid values of an unsigned char, i.e. [0,UCHAR_MAX]. It is expected that this is the common usage of 'b'. An OverflowError is raised if the parsed value is outside this range.
* M.-A. Lemburg <mal@lemburg.com>:Fred Drake2000-05-091-0/+37
| | | | | | Added APIs to allow setting and querying the system's current string encoding: sys.set_string_encoding() and sys.get_string_encoding().