summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* get_completer() takes no argsNeal Norwitz2003-03-011-1/+1
|
* Several of the tools can make direct calls the inner iterators.Raymond Hettinger2003-03-011-9/+24
|
* Fix SF bug #690012 (among others), iconv_codec stops buildNeal Norwitz2003-02-281-3/+3
| | | | | | | | Change setup.py to catch all exceptions. - Rename module if the exception was an ImportError - Only warn if the exception was any other error Revert _iconv_codec to raising a RuntimeError.
* use proper constant instead of comment (noted by nnorwitz)Just van Rossum2003-02-281-1/+1
|
* Fix SF bug #694816, remove comparison of unsigned value < 0Neal Norwitz2003-02-281-2/+2
|
* Patch #683592: unicode support for os.listdir()Just van Rossum2003-02-251-0/+24
| | | | | os.listdir() may now return unicode strings on platforms that set Py_FileSystemDefaultEncoding.
* Change the test encoding from "ISO8859-1" to "ISO-8859-1"Walter Dörwald2003-02-241-4/+4
| | | | | | | | | (see SF bug #690309) and raise ImportErrors instead of RuntimeErrors, so building Python continues even if importing iconv_codecs fails. This is a temporary fix until we get proper configure support for "broken" iconv implementations.
* SF patch #687598, array.append is sloooowNeal Norwitz2003-02-241-2/+47
| | | | This improves speed by about 5.6% for me.
* User requested changes to the itertools module.Raymond Hettinger2003-02-231-52/+236
| | | | | Subsumed times() into repeat(). Added cycle() and chain().
* Use 'ISO8859-1' instead of 'ASCII' when testing whether byteswappingWalter Dörwald2003-02-211-5/+5
| | | | | | | | | | is required for the chosen internal encoding in the init function, as this seems to have a better chance of working under Irix and Solaris. Also change the test character from '\x01' to '0'. This might fix SF bug #690309.
* flex_complete looks like a private (but callback) function, so make it staticNeal Norwitz2003-02-211-1/+1
|
* The connect timeout code wasn't working on Windows.Guido van Rossum2003-02-191-12/+13
| | | | | | Rather than trying to second-guess the various error returns of a second connect(), use select() to determine whether the socket becomes writable (which means connected).
* - PyEval_GetFrame() is now declared to return a PyFrameObject *Guido van Rossum2003-02-191-1/+1
| | | | instead of a plain PyObject *. (SF patch #686601 by Ben Laurie.)
* os.mkdir() would crash with a Unicode filename and mode param.Mark Hammond2003-02-191-1/+1
|
* Use __reduce_ex__.Guido van Rossum2003-02-191-45/+36
|
* save_global(): Trying to resolve module.name can fail for twoTim Peters2003-02-181-3/+5
| | | | | | | reasons: importing module can fail, or the attribute lookup module.name can fail. We were giving the same error msg for both cases, making it needlessly hard to guess what went wrong. These cases give different error msgs now.
* Fold some long lines.Guido van Rossum2003-02-181-14/+31
| | | | Change fatal errors during module initialization into RuntimeErrors.
* Fix 64-bit problem, ParseTuple("i") needs C ints; ("l") needs C longs.Neal Norwitz2003-02-181-1/+1
| | | | | Use "l" as that *probably* makes more sense (at least to me it does :-) And the test passes on the alpha.
* Added test_posix (hopefully it works on Windows).Neal Norwitz2003-02-171-130/+64
| | | | | Remove PyArg_ParseTuple() for methods which take no args, use METH_NOARGS instead
* Use correct function name to PyArg_ParseTuple("is_package").Neal Norwitz2003-02-171-5/+2
| | | | | | | | | | | | Fix off-by-1 error in normalize_line_endings(): when *p == '\0' the NUL was copied into q and q was auto-incremented, the loop was broken out of, then a newline was appended followed by a NUL. So the function, in effect, was strcpy() but added two extra chars which was caught by obmalloc in debug mode, since there was only room for 1 additional newline. Get test working under regrtest (added test_main).
* Make 2 module variables static. Assuming this is correct.Neal Norwitz2003-02-151-2/+2
|
* cPickle.c, load_build(): Taught cPickle how to pick apartTim Peters2003-02-151-21/+71
| | | | | | | | | | | | | | | | | | the optional proto 2 slot state. pickle.py, load_build(): CAUTION: Noted that cPickle's load_build and pickle's load_build really don't do the same things with the state, and didn't before this patch either. cPickle never tries to do .update(), and has no backoff if instance.__dict__ can't be retrieved. There are no tests that can tell the difference, and part of what cPickle's load_build() did looked accidental to me, so I don't know what the true intent is here. pickletester.py, test_pickle.py: Got rid of the hack for exempting cPickle from running some of the proto 2 tests. dictobject.c, PyDict_Next(): documented intended use.
* cPickle produces NEWOBJ appropriately now. It still doesn't knowTim Peters2003-02-141-69/+195
| | | | how to unpickle the new slot-full state tuples.
* Minor assorted cleanups; no semantic changes.Tim Peters2003-02-131-10/+16
|
* The version of PyImport_Import() in cPickle is no longer needed (an editedTim Peters2003-02-131-64/+0
| | | | version was moved into import.c long ago), so squashed the duplication.
* save(): Reformat tail end just for clarity.Tim Peters2003-02-131-16/+17
|
* Another dummy type.Guido van Rossum2003-02-131-0/+61
| | | | | Curious: Str didn't need me to put something in tp_new, but Null did. Why the difference?
* Taught cPickle how to read pickles containing NEWOBJ. This won't getTim Peters2003-02-131-1/+75
| | | | | | exercised by the test suite before cPickle knows how to create NEWOBJ too. For now, it was just tried once by hand (via loading a NEWOBJ pickle created by pickle.py).
* Added a HIGHEST_PROTOCOL module attribute to pickle and cPickle.Tim Peters2003-02-131-5/+9
|
* Conditionalize another constantAndrew M. Kuchling2003-02-131-0/+2
|
* socket_inet_aton(): ip_addr was left undefined before use in theTim Peters2003-02-131-9/+9
| | | | | !HAVE_INET_ATON case. Repaired that, and tried to repair what looked like out-of-date comments.
* Ummm, try to get it right this timeNeal Norwitz2003-02-131-1/+1
|
* Use configure to check for inet_aton.Neal Norwitz2003-02-131-1/+1
|
* Addressing SF bug #643005, implement socket.inet_aton() usingGuido van Rossum2003-02-121-1/+17
| | | | | | | | | inet_aton() rather than inet_addr() -- the latter is obsolete because it has a problem: "255.255.255.255" is a valid address but indistinguishable from an error. (I'm not sure if inet_aton() exists everywhere -- in case it doesn't, I've left the old code in with an #ifdef.)
* Minor cleanup of new batch-list/dict code.Tim Peters2003-02-121-16/+12
|
* Add more missing PyErr_NoMemory() after failled memory allocsNeal Norwitz2003-02-112-3/+3
|
* Implemented batching for dicts in cPickle. This is after two failedTim Peters2003-02-111-30/+119
| | | | | attempts to merge the C list-batch and dict-batch code -- they worked, but it was a godawful mess to read.
* Add Str, a subclass of str.Guido van Rossum2003-02-111-0/+58
|
* Implemented list batching in cPickle.Tim Peters2003-02-111-30/+103
|
* Unparenting BZ2File, as discussed in SF patch #661796.Gustavo Niemeyer2003-02-111-102/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Modules/bz2module.c (BZ2FileObject): Now the structure includes a pointer to a file object, instead of "inheriting" one. Also, some members were copied from the PyFileObject structure to avoid dealing with the internals of that structure from outside fileobject.c. (Util_GetLine,Util_DropReadAhead,Util_ReadAhead,Util_ReadAheadGetLineSkip, BZ2File_write,BZ2File_writelines,BZ2File_init,BZ2File_dealloc, BZ2Comp_dealloc,BZ2Decomp_dealloc): These functions were adapted to the change above. (BZ2File_seek,BZ2File_close): Use PyObject_CallMethod instead of getting the function attribute locally. (BZ2File_notsup): Removed, since it's not necessary anymore to overload truncate(), and readinto() with dummy functions. (BZ2File_methods): Added xreadlines() as an alias to BZ2File_getiter, and removed truncate() and readinto(). (BZ2File_get_newlines,BZ2File_get_closed,BZ2File_get_mode,BZ2File_get_name, BZ2File_getset): Implemented getters for "newlines", "mode", and "name". (BZ2File_members): Implemented "softspace" member. (BZ2File_init): Reworked to create a file instance instead of initializing itself as a file subclass. Also, pass "name" object untouched to the file constructor, and use PyObject_CallFunction instead of building the argument tuple locally. (BZ2File_Type): Set tp_new to PyType_GenericNew, tp_members to BZ2File_members, and tp_getset to BZ2File_getset. (initbz2): Do not set BZ2File_Type.tp_base nor BZ2File_Type.tp_new. * Doc/lib/libbz2.tex Do not mention that BZ2File inherits from the file type.
* SF bug 684667: Modules/selectmodule.c returns NULL without exception set.Tim Peters2003-02-111-1/+1
| | | | | select_select() didn't set an exception in the SELECT_USES_HEAP case when malloc() returned NULL.
* Patch #676839: Cygwin _iconv_codec module patchJason Tishler2003-02-101-1/+2
| | | | | The attached patch enables the _iconv_codec module to build cleanly under Cygwin.
* Patch #676837: Cygwin array module patchJason Tishler2003-02-101-1/+2
| | | | | The attached patch enables the array module to build cleanly under Cygwin again.
* Fix memory leak of newstr when putenv() failsNeal Norwitz2003-02-101-0/+1
|
* Remove duplicate code introduced by fixing bug #678518Neal Norwitz2003-02-101-3/+0
|
* Remove unused variable.Guido van Rossum2003-02-092-2/+1
|
* C Code:Raymond Hettinger2003-02-091-124/+248
| | | | | | | | | | | | | | | * Removed the ifilter flag wart by splitting it into two simpler functions. * Fixed comment tabbing in C code. * Factored module start-up code into a loop. Documentation: * Re-wrote introduction. * Addede examples for quantifiers. * Simplified python equivalent for islice(). * Documented split of ifilter(). Sets.py: * Replace old ifilter() usage with new.
* Apply logistix's patch fromMichael W. Hudson2003-02-081-3/+43
| | | | [ 678518 ] Another parsermodule validation error
* timedelta comparison and datetime addition: as the Python implementationTim Peters2003-02-081-4/+4
| | | | of datetime does, accept instances of subclasses too.
* Comparison for timedelta, time, date and datetime objects: __eq__ andTim Peters2003-02-071-38/+52
| | | | | | | | | | | | | | | | | __ne__ no longer complain if they don't know how to compare to the other thing. If no meaningful way to compare is known, saying "not equal" is sensible. This allows things like if adatetime in some_sequence: and somedict[adatetime] = whatever to work as expected even if some_sequence contains non-datetime objects, or somedict non-datetime keys, because they only call __eq__. It still complains (raises TypeError) for mixed-type comparisons in contexts that require a total ordering, such as list.sort(), use as a key in a BTree-based data structure, and cmp().