Commit Graph

2915 Commits

Author SHA1 Message Date
Guido van Rossum 99d4abf8a2 Support socket timeout in SSL, by Geoff Talvola.
(SF patch #675750, to fix SF bug #675552.)
2003-01-27 22:22:50 +00:00
Martin v. Löwis 7a565f0b9b Fix reference counting of iconvcodec_Type. Fixes #670715.
Remove GC code; the base type does not need GC.
2003-01-27 11:39:04 +00:00
Neal Norwitz 57c115c8ad Get rid of compiler warnings on Redhat 2003-01-26 16:26:20 +00:00
Martin v. Löwis 727fe66f27 Add _iconv_codec to Setup.dist. Use PyModule_ functions. 2003-01-26 11:48:20 +00:00
Martin v. Löwis 9789aefa61 Patch #670715: Universal Unicode Codec for POSIX iconv. 2003-01-26 11:30:36 +00:00
Martin v. Löwis c35d199404 Undo inclusion of Python.h. Remove HAVE_MEMCPY section.
Update Windows command line.
2003-01-26 08:40:50 +00:00
Martin v. Löwis 94ac339d21 Uncomment usage of expat_config.h 2003-01-25 22:48:51 +00:00
Martin v. Löwis fc03a94aac Incorporate Expat 1.95.6. 2003-01-25 22:41:29 +00:00
Tim Peters 8d81a012ef date and datetime comparison: when we don't know how to
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.
2003-01-24 22:36:34 +00:00
Tim Peters 8bb5ad2e56 Updated the astimezone() proof to recover from all the last week's
changes (and there were a lot of relevant changes!).
2003-01-24 02:44:45 +00:00
Neal Norwitz 2fbe5378f9 Fix typo 2003-01-23 21:09:05 +00:00
Tim Peters 2a44a8d332 SF bug 660872: datetimetz constructors behave counterintuitively (2.3a1).
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.
2003-01-23 20:53:10 +00:00
Tim Peters 10cadce41e Reimplemented datetime.now() to be useful. 2003-01-23 19:58:02 +00:00
Tim Peters b1049e8eca fromutc(): Repair incorrect failure return, as noted by NealN. Thanks! 2003-01-23 17:20:36 +00:00
Tim Peters 52dcce24e2 Bringing the code and test suite into line with doc and NEWS changes
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).
2003-01-23 16:36:11 +00:00
Martin v. Löwis 70c3dda2fb Convert booleans to integers in IntVar.set. Fixes #671741.
Return booleans from _tkinter.getboolean.
Convert booleans to Tcl booleans in AsObj.
2003-01-22 09:17:38 +00:00
Martin v. Löwis cd9a8b6bcf Avoid usage of PyDoc_STR in 2.2 compatibility code. 2003-01-21 21:52:57 +00:00
Martin v. Löwis c847f4040d Conditionalize features not found in PyXML 1.95.2. 2003-01-21 11:09:21 +00:00
Martin v. Löwis 069dde2be3 Merge with PyXML 1.71:
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.
2003-01-21 10:58:18 +00:00
Tim Peters 327098a613 New rule for tzinfo subclasses handling both standard and daylight time:
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.
2003-01-20 22:54:38 +00:00
Neal Norwitz fa56e2dc40 SF # 669553, fix memory (ref) leaks
Will backport.
2003-01-19 15:40:09 +00:00
Tim Peters 513a1cd103 Windows flavor of floatsleep(): folded long lines, introduced a temp
var for clarity.
2003-01-19 04:54:58 +00:00
Raymond Hettinger 9543b34006 SF patch #670423: Add missing identity tests to operator.c 2003-01-18 23:22:20 +00:00
Tim Peters 8b19a93b87 When time.localtime() is passed a tick count the platform C localtime()
function can't handle, don't raise IOError -- that doesn't make sense.
Raise ValueError instead.

Bugfix candidate.
2003-01-17 20:08:54 +00:00
Gregory P. Smith b6c9f78074 bugfix: do not double-close DB cursor during deallocation when the
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
2003-01-17 08:42:50 +00:00
Gregory P. Smith aa71f5f2b4 bugfix: allow the module to work with python compiled without thread support.
closes sourceforge pybsddb bug id 669533.
2003-01-17 07:56:16 +00:00
Gregory P. Smith c25fd3fb48 bugfix: disallow use of DB_TXN after commit() or abort(), prevents a
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.
2003-01-17 07:52:59 +00:00
Tim Peters a9bc168f95 Got rid of the internal datetimetz type. 2003-01-11 03:39:11 +00:00
Tim Peters a032d2eb7f Minor fiddling to make the next part easier. Introduced an internal
HASTZINFO() macro.
2003-01-11 00:15:54 +00:00
Neal Norwitz faa7b9bb4c Get build working on Redhat 7.2 linux 2.4.7 2003-01-10 21:27:54 +00:00
Neal Norwitz e604c02a80 SF #665913, Fix mmap module core dump with unix
Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump.

Will backport.
2003-01-10 20:52:16 +00:00
Neal Norwitz 8e914d9a1d Get rid of compiler warnings 2003-01-10 15:29:16 +00:00
Tim Peters 37f398282b Got rid of the timetz type entirely. This was a bit trickier than I
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.
2003-01-10 03:49:02 +00:00
Tim Peters 33e0f383d4 Removed more now-pointless pickle code. 2003-01-10 02:05:14 +00:00
Tim Peters 7d4b315cca Deleted pickle/unpickle code for the old datetime and time classes -- it's
unreachable now.
2003-01-08 20:51:36 +00:00
Tim Peters 0bf60bd67f Utterly minimal changes to collapse datetimetz into datetime, and timetz
into time.  This is little more than *exporting* the datetimetz object
under the name "datetime", and similarly for timetz.  A good implementation
of this change requires more work, but this is fully functional if you
don't stare too hard at the internals (e.g., right now a type named
"datetime" shows up as a base class of the type named "datetime").  The
docs also need extensive revision, not part of this checkin.
2003-01-08 20:40:01 +00:00
Jack Jansen b8941f2dbe Added a couple of casts to make this compile with CodeWarrior. 2003-01-08 16:28:45 +00:00
Barry Warsaw 5676bd1c2d all_ins(): EX_OK and friends, constants from sysexits.h 2003-01-07 20:57:09 +00:00
Guido van Rossum 6d0d3655af Fix from Michael Stone for SF bug #660476 and #513033 (bogus thread
state swaps in readline).
2003-01-07 20:34:19 +00:00
Guido van Rossum 05ac449d29 A few more whitespace normalizations. 2003-01-07 20:04:12 +00:00
Guido van Rossum 74f3143d18 Various cleanups:
- Whitespace normalization.

- Cleaned up some comments.

- Broke long lines.
2003-01-07 20:01:29 +00:00
Raymond Hettinger 625812f618 SF patch #662433: Fill arraymodule's tp_iter and sq_contains slots 2003-01-07 01:58:52 +00:00
Jason Tishler fb8595df4f Patch #661760: Cygwin auto-import module patch
The attached patch enables shared extension
modules to build cleanly under Cygwin without
moving the static initialization of certain function
pointers (i.e., ones exported from the Python
DLL core) to a module initialization function.

Additionally, this patch fixes the modules that
have been changed in the past to accommodate
Cygwin.
2003-01-06 12:41:26 +00:00
Tim Peters 75a6e3bd1a datetime_from_timet_and_us(): ignore leap seconds if the platform
localtime()/gmtime() insists on delivering them, + associated doc
changes.

Redid the docs for datetimtez.astimezone().
2003-01-04 18:17:36 +00:00
Martin v. Löwis 3a57d9de07 Fix typo. 2003-01-04 08:54:59 +00:00
Martin v. Löwis 6a759d9e00 Remove appartment check from dooneevent. Fixes #660961.
Check whether self is NULL in mainloop.
2003-01-04 08:36:57 +00:00
Tim Peters adf642038e A new implementation of astimezone() that does what we agreed on in all
cases, plus even tougher tests of that.  This implementation follows
the correctness proof very closely, and should also be quicker (yes,
I wrote the proof before the code, and the code proves the proof <wink>).
2003-01-04 06:03:15 +00:00
Neal Norwitz 506a224688 Fix compiler warning 2003-01-04 01:02:25 +00:00
Martin v. Löwis 3919571f82 Wrap doc strings in PyDoc_STRVAR. Fix .string docstring. Provide default
macro definitions for older Python releases.
2003-01-04 00:33:13 +00:00
Tim Peters 4fede1a36b Completed astimezone()'s correctness proof. This also proves we can get
the desired compromise behavior during the "problem hour" when DST ends
cheaply (but I haven't yet implemented that).
2003-01-04 00:26:59 +00:00