summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Move itertools module from the sandbox and into production.Raymond Hettinger2003-02-011-0/+1532
|
* The various datetime object __setstate__() methods are no longer publicTim Peters2003-01-311-116/+105
| | | | | | | | (pickling no longer needs them, and immutable objects shouldn't have visible __setstate__() methods regardless). Rearranged the code to put the internal setstate functions in the constructor sections. Repaired the timedelta reduce() method, which was still producing stuff that required a public timedelta.__setstate__() when unpickling.
* Ignore the state returned by __reduce__ if it is Py_None.Guido van Rossum2003-01-311-0/+2
|
* SF patch #678257 by Geoff Talvola.Guido van Rossum2003-01-311-1/+1
| | | | | In sendall(), do an internal select before each send() call, instead of only for the first one.
* SF patch 676472 by Geoff Talvola, reviewed by Ben Laurie.Guido van Rossum2003-01-311-13/+65
| | | | | | | | | | | | Geoff writes: This is yet another patch to _ssl.c that sets the underlying BIO to non-blocking if the socket being wrapped is non-blocking. It also correctly loops when SSL_connect, SSL_write, or SSL_read indicates that it needs to read or write more bytes. This seems to fix bug #673797 which was not fixed by my previous patch.
* Change the treatment of positions returned by PEP293Walter Dörwald2003-01-311-4/+14
| | | | | | | | | | | | | | | | error handers in the Unicode codecs: Negative positions are treated as being relative to the end of the input and out of bounds positions result in an IndexError. Also update the PEP and include an explanation of this in the documentation for codecs.register_error. Fixes a small bug in iconv_codecs: if the position from the callback is negative *add* it to the size instead of substracting it. From SF patch #677429.
* Initialize swappedinput to silence the compiler warning aboutWalter Dörwald2003-01-311-1/+1
| | | | uninitialized variables.
* _PyLong_NumBits(): The definition of this was too specific to the quirkyTim Peters2003-01-311-21/+27
| | | | | | | | | needs of pickling longs. Backed off to a definition that's much easier to understand. The pickler will have to work a little harder, but other uses are more likely to be correct <0.5 wink>. _PyLong_Sign(): New teensy function to characterize a long, as to <0, ==0, or >0.
* Backward branches are disgusting, at least when a forward branchTim Peters2003-01-311-6/+6
| | | | is just as easy.
* Change the approach to pickling to use __reduce__ everywhere. MostGuido van Rossum2003-01-301-242/+221
| | | | | | | classes have a __reduce__ that returns (self.__class__, self.__getstate__()). tzinfo.__reduce__() is a bit smarter, calling __getinitargs__ and __getstate__ if they exist, and falling back to __dict__ if it exists and isn't empty.
* Check whether the choosen encoding requires byte swappingWalter Dörwald2003-01-301-1/+79
| | | | | | | | | | | | | | | for this iconv() implementation in the init function. For encoding: use a byteswapped version of the input if neccessary. For decoding: byteswap every piece returned by iconv() if neccessary (but not those pieces returned from the callback) Comment out test_sane() in the test script, because whether this works depends on whether byte swapping is neccessary or not (an on Py_UNICODE_SIZE)
* I was in this module anyway, so I did some janitorial things.Michael W. Hudson2003-01-301-17/+14
| | | | | | | | METH_NOARGS functions are still called with two arguments, one NULL, so put that back into the function definitions (I didn't know this until recently). Make get_history_length() METH_NOARGS.
* Add the get_completer() function based on Michael Stone's patch inMichael W. Hudson2003-01-301-0/+17
| | | | | | [ 676342 ] after using pdb readline does not work correctly which is required to fix that bug. So maaybe a bugfix candidate.
* Teach the parsermodule about floor division. FixesMichael W. Hudson2003-01-291-0/+2
| | | | | | [ 676521 ] parser module validation failure bugfix candidate.
* Added new private API function _PyLong_NumBits. This will be used at theTim Peters2003-01-281-2/+39
| | | | | | | start for the C implemention of new pickle LONG1 and LONG4 opcodes (the linear-time way to pickle a long is to call _PyLong_AsByteArray, but the caller has no idea how big an array to allocate, and correct calculation is a bit subtle).
* Bump the version numberBarry Warsaw2003-01-281-1/+1
|
* Update to the final version released as Expat 1.95.6 (maintainingFred Drake2003-01-281-78/+66
| | | | Martin's integration changes).
* Support socket timeout in SSL, by Geoff Talvola.Guido van Rossum2003-01-271-0/+51
| | | | (SF patch #675750, to fix SF bug #675552.)
* Fix reference counting of iconvcodec_Type. Fixes #670715.Martin v. Löwis2003-01-271-6/+4
| | | | Remove GC code; the base type does not need GC.
* Get rid of compiler warnings on RedhatNeal Norwitz2003-01-261-2/+2
|
* Add _iconv_codec to Setup.dist. Use PyModule_ functions.Martin v. Löwis2003-01-262-8/+6
|
* Patch #670715: Universal Unicode Codec for POSIX iconv.Martin v. Löwis2003-01-261-0/+626
|
* Undo inclusion of Python.h. Remove HAVE_MEMCPY section.Martin v. Löwis2003-01-261-12/+0
| | | | Update Windows command line.
* Uncomment usage of expat_config.hMartin v. Löwis2003-01-251-0/+2
|
* Incorporate Expat 1.95.6.Martin v. Löwis2003-01-2510-3941/+5444
|
* date and datetime comparison: when we don't know how toTim Peters2003-01-241-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | compare against "the other" argument, we raise TypeError, in order to prevent comparison from falling back to the default (and worse than useless, in this case) comparison by object address. That's fine so far as it goes, but leaves no way for another date/datetime object to make itself comparable to our objects. For example, it leaves Marc-Andre no way to teach mxDateTime dates how to compare against Python dates. Discussion on Python-Dev raised a number of impractical ideas, and the simple one implemented here: when we don't know how to compare against "the other" argument, we raise TypeError *unless* the other object has a timetuple attr. In that case, we return NotImplemented instead, and Python will give the other object a shot at handling the comparison then. Note that comparisons of time and timedelta objects still suffer the original problem, though.
* Updated the astimezone() proof to recover from all the last week'sTim Peters2003-01-241-77/+94
| | | | changes (and there were a lot of relevant changes!).
* Fix typoNeal Norwitz2003-01-231-1/+1
|
* SF bug 660872: datetimetz constructors behave counterintuitively (2.3a1).Tim Peters2003-01-231-12/+20
| | | | | | This gives much the same treatment to datetime.fromtimestamp(stamp, tz) as the last batch of checkins gave to datetime.now(tz): do "the obvious" thing with the tz argument instead of a senseless thing.
* Reimplemented datetime.now() to be useful.Tim Peters2003-01-231-7/+17
|
* fromutc(): Repair incorrect failure return, as noted by NealN. Thanks!Tim Peters2003-01-231-1/+1
|
* Bringing the code and test suite into line with doc and NEWS changesTim Peters2003-01-231-92/+127
| | | | | | | | | | | | | | | | | | | | checked in two days agao: Refactoring of, and new rules for, dt.astimezone(tz). dt must be aware now, and tz.utcoffset() and tz.dst() must not return None. The old dt.astimezone(None) no longer works to change an aware datetime into a naive datetime; use dt.replace(tzinfo=None) instead. The tzinfo base class now supplies a new fromutc(self, dt) method, and datetime.astimezone(tz) invokes tz.fromutc(). The default implementation of fromutc() reproduces the same results as the old astimezone() implementation, but tzinfo subclasses can override fromutc() if the default implementation isn't strong enough to get the correct results in all cases (for example, this may be necessary if a tzinfo subclass models a time zone whose "standard offset" (wrt UTC) changed in some year(s), or in some variations of double-daylight time -- the creativity of time zone politics can't be captured in a single default implementation).
* Convert booleans to integers in IntVar.set. Fixes #671741.Martin v. Löwis2003-01-221-1/+3
| | | | | Return booleans from _tkinter.getboolean. Convert booleans to Tcl booleans in AsObj.
* Avoid usage of PyDoc_STR in 2.2 compatibility code.Martin v. Löwis2003-01-211-1/+1
|
* Conditionalize features not found in PyXML 1.95.2.Martin v. Löwis2003-01-211-0/+15
|
* Merge with PyXML 1.71:Martin v. Löwis2003-01-211-16/+136
| | | | | | | | | | | | | | | | | | | | | | 60: Added support for the SkippedEntityHandler, new in Expat 1.95.4. 61: Added support for namespace prefixes, which can be enabled by setting the "namespace_prefixes" attribute on the parser object. 65: Disable profiling changes for Python 2.0 and 2.1. 66: Update pyexpat to export the Expat 1.95.5 XML_GetFeatureList() information, and tighten up a type declaration now that Expat is using an incomplete type rather than a void * for the XML_Parser type. 67: Clarified a comment. Added support for XML_UseForeignDTD(), new in Expat 1.95.5. 68: Refactor to avoid partial duplication of the code to construct an ExpatError instance, and actually conform to the API for the exception instance as well. 69: Remove some spurious trailing whitespace. Add a special external-entity-ref handler that gets installed once a handler has raised a Python exception; this can cancel actual parsing earlier if there's an external entity reference in the input data after the the Python excpetion has been raised. 70: Untabify APPEND. 71: Backport PyMODINIT_FUNC for 2.2 and earlier.
* New rule for tzinfo subclasses handling both standard and daylight time:Tim Peters2003-01-201-21/+3
| | | | | | | | | | | | When daylight time ends, an hour repeats on the local clock (for example, in US Eastern, the clock jumps from 1:59 back to 1:00 again). Times in the repeated hour are ambiguous. A tzinfo subclass that wants to play with astimezone() needs to treat times in the repeated hour as being standard time. astimezone() previously required that such times be treated as daylight time. There seems no killer argument either way, but Guido wants the standard-time version, and it does seem easier the new way to code both American (local-time based) and European (UTC-based) switch rules, and the astimezone() implementation is simpler.
* SF # 669553, fix memory (ref) leaksNeal Norwitz2003-01-191-13/+25
| | | | Will backport.
* Windows flavor of floatsleep(): folded long lines, introduced a tempTim Peters2003-01-191-12/+17
| | | | var for clarity.
* SF patch #670423: Add missing identity tests to operator.cRaymond Hettinger2003-01-181-0/+24
|
* When time.localtime() is passed a tick count the platform C localtime()Tim Peters2003-01-171-1/+1
| | | | | | | function can't handle, don't raise IOError -- that doesn't make sense. Raise ValueError instead. Bugfix candidate.
* bugfix: do not double-close DB cursor during deallocation when theGregory P. Smith2003-01-171-1/+3
| | | | | | | | | | underlying DB has already been closed (and thus all of its cursors). This fixes a potential segfault. SF pybsddb bug id 667343 bugfix: close the DB object when raising an exception due to an error during DB.open. This prevents an exception when closing the environment about not all databases being closed. SF pybsddb bug id 667340
* bugfix: allow the module to work with python compiled without thread support.Gregory P. Smith2003-01-171-0/+2
| | | | closes sourceforge pybsddb bug id 669533.
* bugfix: disallow use of DB_TXN after commit() or abort(), prevents aGregory P. Smith2003-01-171-5/+37
| | | | | | | | | coredump or segmentation violation. Sourceforge patch ID 664896: http://sourceforge.net/tracker/index.php?func=detail&aid=664896&group_id=13900&atid=313900 The bug was reported on the pybsddb-users mailing list.
* Got rid of the internal datetimetz type.Tim Peters2003-01-111-1004/+635
|
* Minor fiddling to make the next part easier. Introduced an internalTim Peters2003-01-111-17/+20
| | | | HASTZINFO() macro.
* Get build working on Redhat 7.2 linux 2.4.7Neal Norwitz2003-01-101-0/+4
|
* SF #665913, Fix mmap module core dump with unixNeal Norwitz2003-01-101-2/+4
| | | | | | Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump. Will backport.
* Get rid of compiler warningsNeal Norwitz2003-01-102-19/+19
|
* Got rid of the timetz type entirely. This was a bit trickier than ITim Peters2003-01-101-476/+336
| | | | | | | hoped it would be, but not too bad. A test had to change: time.__setstate__() can no longer add a non-None tzinfo member to a time object that didn't already have one, since storage for a tzinfo member doesn't exist in that case.