Commit Graph

1389 Commits

Author SHA1 Message Date
Tim Peters b57f8f02ba There's no good reason for datetime objects to expose __getstate__()
anymore either, so don't.  This also allows to get rid of obscure code
making __getnewargs__ identical to __getstate__ (hmm ... hope there
wasn't more to this than I realize!).
2003-02-01 02:54:15 +00:00
Raymond Hettinger 96ef8115dd Move itertools module from the sandbox and into production. 2003-02-01 00:10:11 +00:00
Tim Peters 506be287aa The various datetime object __setstate__() methods are no longer public
(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.
2003-01-31 22:27:17 +00:00
Thomas Heller dda583df9a Patch #669198: Add cflags to RC compile. 2003-01-31 20:45:41 +00:00
Neal Norwitz abcb0c03ad Fix SF bug# 676155, RuntimeWarning with tp_compare
Check return value of PyLong_AsDouble(), it can return an error.
2003-01-28 19:21:24 +00:00
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
Tim Peters 8ecfc8ef9d Moving pickletools.py from the sandbox into the std library. I started
this over the weekend, and it made faster & better progress than I
expected -- it's already useful <wink>.
2003-01-27 18:51:48 +00:00
Jack Jansen 1a1b6e4157 Attempting to keep the Mac section of the NEWS file up-to-date, in stead
of the usual frantic editing at the last moment:-)
2003-01-27 15:21:39 +00:00
Martin v. Löwis 9789aefa61 Patch #670715: Universal Unicode Codec for POSIX iconv. 2003-01-26 11:30:36 +00:00
Raymond Hettinger e685f9438d Part 3 of Py2.3 update 2003-01-26 03:29:15 +00:00
Neal Norwitz e4c40da055 SF #642974, logging SysLogHandler proto type wrong
Syslog uses UDP (SOCK_DGRAM)
2003-01-26 02:45:47 +00:00
Martin v. Löwis 8afd7571a1 Patch #636005: Filter unicode into unicode. 2003-01-25 22:46:11 +00:00
Raymond Hettinger 5a772d32f4 Part II of Python2.3 update 2003-01-25 22:35:42 +00:00
Raymond Hettinger 7234884f61 Part I of an update for Python 2.3. 2003-01-25 21:22:52 +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
Neil Schemenauer cd63e619b4 Add news about getargs change. 2003-01-24 22:15:53 +00:00
Tim Peters 0064026668 Bump the Windows build to use Sleepycat's 4.1.25.NC release (the
latest bsddb release without strong cryptography).
2003-01-24 15:31:31 +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
Skip Montanaro 9a7c96a2bc add support for Python's bool type to xmlrpclib - patch # 559288 2003-01-22 18:17:25 +00:00
Tim Peters f196a0a4dd "Premature" doc changes, for new astimezone() rules, and the new
tzinfo.fromutc() method.  The C code doesn't implement any of this
yet (well, not the C code on the machine I'm using now), nor does
the test suite reflect it.  The Python datetime.py implementation and
test suite in the sandbox do match these doc changes.  The C
implementation probably won't catch up before Thursday (Wednesday is
a scheduled "black hole" day this week <0.4 wink>).
2003-01-22 04:45:50 +00:00
Raymond Hettinger 9543b34006 SF patch #670423: Add missing identity tests to operator.c 2003-01-18 23:22:20 +00:00
Martin v. Löwis b32c886d71 Gyro Func for patch #661719. 2003-01-15 11:53:13 +00:00
Martin v. Löwis 0c6774d92b Patch #661719: Expose compilation errors as exceptions on request. 2003-01-15 11:51:06 +00:00
Martin v. Löwis d69663d300 Patch #473586: Implement CGIXMLRPCRequestHandler. 2003-01-15 11:37:23 +00:00
Guido van Rossum 50e92235e7 Explicitly raise an exception in __cmp__ -- this clarifies that cmp()
is not supported on sets.  (Unfortunately, sorting a list of sets may
still return random results because it uses < exclusively, but for
sets that inly implements a partial ordering.  Oh well.)
2003-01-14 16:45:04 +00:00
Neal Norwitz 1a9975014f Fix SF bug #667147, Segmentation fault printing str subclass
Fix infinite recursion which occurred when printing an object
whose __str__() returned self.

Will backport
2003-01-13 20:13:12 +00:00
Neal Norwitz 74a032ea1f SF #639945 was fixed in alpha 1 2003-01-10 23:29:48 +00:00
Neal Norwitz e931ed59d3 Fix SF bug # 602259, 3rd parameter for Tkinter.scan_dragto
Add the optional gain parameter and pass it to Tk.
2003-01-10 23:24:32 +00:00
Neal Norwitz df8b47fc80 SF #665913, Fix mmap module core dump with unix
Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump.
2003-01-10 20:57:54 +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 05d284b7aa Made "ascii" the default encoding for MacPython, as suggested by MvL, and ripped out my previous changes to test_unicode. Doing this for 2.3a1 should give people enough time to complain, if they want to, and then we can see whether we want to do anything about it. 2003-01-08 16:29:17 +00:00
Thomas Heller 6c64fa7dda Mention the change from patch #664376. 2003-01-08 15:14:55 +00:00
Guido van Rossum cd0c047619 Note about rexec.py and Bastion.py. This requires doc changes and
whatsnew updates as well.
2003-01-07 23:03:05 +00:00
Barry Warsaw f8ba39c4c0 A note about EX_OK and friends in the posixmodule. 2003-01-07 20:55:26 +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
Skip Montanaro ead73b88da removing - contains outdated information 2003-01-06 17:14:28 +00:00
Neal Norwitz 4f442372cc SF feature #618024, urlparse fails on imap:// 2003-01-06 06:51:36 +00:00
Neal Norwitz b9ef4aea5e SF #651082, tarfile module implementation from Lars Gustäbel 2003-01-05 23:19:43 +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
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
Skip Montanaro 950cdacfa5 Moved this info to the top-level README where all the other
platform-specific verbiage lives.
2003-01-04 04:12:19 +00:00
Tim Peters 7702304885 Remark about datetime tzinfo examples. 2003-01-03 22:35:24 +00:00
Martin v. Löwis af6a27a704 Allow PyFile_GetLine() to return Unicode objects. Fixes #660165. 2003-01-03 19:16:14 +00:00
Neal Norwitz bb0246ac25 Fix SF #659228, 'realpath' function missing from os.path
Also added realpath = abspath for os2emx, similar to windows/mac
which also don't really implement realpath.

Backport candidate, I think?
2003-01-03 18:12:28 +00:00
Greg Ward 6c58d4643a Mention ossaudiodev. 2003-01-03 18:02:15 +00:00
Guido van Rossum 747f8060a6 Mention that imaplib now supports SSL -- this wasn't noted before. 2003-01-03 16:33:49 +00:00
David Goodger f349e26e4d Fixed markup. 2003-01-03 03:30:21 +00:00
David Goodger c633365b88 Updated (2.3 OK now) 2003-01-03 03:29:58 +00:00
Tim Peters 397301eccb The tzinfo methods utcoffset() and dst() must return a timedelta object
(or None) now.  In 2.3a1 they could also return an int or long, but that
was an unhelpfully redundant leftover from an earlier version wherein
they couldn't return a timedelta.  TOOWTDI.
2003-01-02 21:28:08 +00:00
Skip Montanaro 4abd5f0fce Allow list sort's comparison function to explicitly be None. See SF patch
661092.
2003-01-02 20:51:08 +00:00
Tim Peters 710fb1548a astimezone() internals: if utcoffset() returns a duration, complain if
dst() returns None (instead of treating that as 0).
2003-01-02 19:35:54 +00:00
Tim Peters 0123139d66 Added a section to record datetime changes. There's apparently going to
be an unbounded number of API changes <0.6 wink>.
2003-01-02 19:10:19 +00:00
Tim Peters bbc5d1674b SF bug 660795: logging missing from Python 2.3a1 for Windows.
Added the logging package.  In the meantime, Neal Norwitz added a
test_logging.py to the std test suite, which would have caught this
oversight in the Windows installer.
2003-01-02 16:02:27 +00:00
Skip Montanaro decc6a47df Split OPT make variable into OPT and BASECFLAGS. The latter contains those
compiler flags which are necessary to get a clean compile.  The former is
for user-specified optimizer, debug, trace fiddling.  See patch 640843.

Add /sw/lib and /sw/include to setup.py search paths on Darwin to take
advantage of fink goodies.

Add scriptsinstall target to Makefile to install certain scripts from
Tools/scripts directory.
2003-01-01 20:07:49 +00:00
Martin v. Löwis 14e73b1864 Expose I_ constants. Auto-detect stropts.h. Properly configure the slave terminal. 2003-01-01 09:51:12 +00:00
Guido van Rossum f970d61c92 Add recipe for creating NEWS.html. 2002-12-31 17:51:30 +00:00
Skip Montanaro 6c5bc3457c Bernhard Herzog's paragraph and string-filling code. I've been using it for
a month or two with great success.  Barry may want to tweak it some, but I
think it's a worthwhile enough addition to get some more people trying it
out.
2002-12-31 16:56:20 +00:00
Just van Rossum 5e156add1f modulefinder.py moved to Lib/ 2002-12-31 16:38:01 +00:00
Guido van Rossum ae5488609a Set the release date. 2002-12-31 15:47:36 +00:00
Guido van Rossum 5ee95474c1 Revert SF patch 659809 -- it causes double options that can cause breakage. 2002-12-31 13:48:29 +00:00
Martin v. Löwis b96152c42e Add getloadavg. 2002-12-31 13:20:15 +00:00
Martin v. Löwis 96a60e4af5 Patch #658927: Add getctime to os.path.
Document that getatime and getmtime may return floats.
2002-12-31 13:11:54 +00:00
Martin v. Löwis 24a880b499 Patch #656590: /dev/ptmx support for ptys. 2002-12-31 12:55:15 +00:00
Just van Rossum 01875ebaec Broke the zipimport/PEP 302 news item into two separate items. 2002-12-31 10:22:38 +00:00
Guido van Rossum 9a2eda5ea5 Dedent a paragraph that was accidentally aligned with a preceding
nested list.
2002-12-31 02:12:42 +00:00
Guido van Rossum a3b8953233 News about zipimport. 2002-12-30 22:59:32 +00:00
Jack Jansen 8bb80dbe10 Added a note about the move of Mac/Lib to Lib/plat-mac. 2002-12-30 22:42:43 +00:00
Guido van Rossum acd738feb3 SF patch 659809, by Daniel Brotsky: fix Makefile.pre to use config
env.

This adds @CFLAGS@  and @CPPFLAGS@ to the end of the respective
variable definitions.  It also adds $(LDFLAGS) to the $(CC) invocation
to build $(PGEN).
2002-12-30 21:04:23 +00:00
Barry Warsaw c27f4bd423 A short note about the versions of BerkeleyDB we now support 2002-12-30 21:03:26 +00:00
Neil Schemenauer b983aa0003 Add news about fix for bug #624807. 2002-12-30 20:22:23 +00:00
Barry Warsaw 497e5c4f8e Update the email package news. 2002-12-30 19:27:08 +00:00
Raymond Hettinger 40f6217092 SF patch 658251: Install a C implementation of the Mersenne Twister as the
core generator for random.py.
2002-12-29 23:03:38 +00:00
Raymond Hettinger af72d5221f Add newsitem for the two new unittest methods.
Also, made some whitespace cleanup.
2002-12-29 20:14:11 +00:00
Tim Peters 4643bd9a9c Apparently FreeBSD enables some HW floating-point exceptions by default.
This can cause core dumps when Python runs.  Python relies on the 754-
(and C99-) mandated default "non-stop" mode for FP exceptions.  This
patch from Ben Laurie disables at least one FP exception on FreeBSD at
Python startup time.
2002-12-28 21:56:08 +00:00
Just van Rossum 8982595870 Backing out patch #642578 in anticipation of final acceptance of PEP 302. 2002-12-25 23:13:34 +00:00
Raymond Hettinger e11b510a5b SF 658405: calendar.py to rely on the datetime module instead of the time
module.

The code is shorter, more readable, faster, and dramatically increases the
range of acceptable dates.

Also, used the floor division operator in leapdays().
2002-12-25 16:37:19 +00:00
Guido van Rossum 633d90c7a3 Oops. Roll back that last change. It wasn't ready for release. :-( 2002-12-23 16:51:42 +00:00
Guido van Rossum 9c8a0866c9 Add warning for assignment to None, True and False. This is patch
549213 by Jeremy (checking in for him since he's away and busy).
2002-12-23 16:35:23 +00:00
Jack Jansen ae3cb6cf29 Got rid of Mac/Relnotes, and started on mac-specific release notes in NEWS. 2002-12-23 11:25:49 +00:00
Michael W. Hudson cfd3884882 This is Richie Hindle's patch
[ 643835 ] Set Next Statement for Python debuggers

with a few tweaks by me: adding an unsigned or two, mentioning that
not all jumps are allowed in the doc for pdb, adding a NEWS item and
a note to whatsnew, and AuCTeX doing something cosmetic to libpdb.tex.
2002-12-17 16:15:34 +00:00
Tim Peters e820cb60a3 Blurb about new datetime module. 2002-12-16 20:57:22 +00:00
Gustavo Niemeyer 786ddb29c9 Fixed bug
[#521782] unreliable file.read() error handling

* Objects/fileobject.c
  (file_read): Clear errors before leaving the loop in all situations,
  and also check if some data was read before exiting the loop with an
  EWOULDBLOCK exception.

* Doc/lib/libstdtypes.tex
* Objects/fileobject.c
  Document that sometimes a read() operation can return less data than
  what the user asked, if running in non-blocking mode.

* Misc/NEWS
  Document the fix.
2002-12-16 18:12:53 +00:00
Gustavo Niemeyer 17c5a33582 Use "dictionary literals" instead of "dictionaries", as suggested by Just. 2002-12-16 14:09:22 +00:00
Gustavo Niemeyer 78429a6aa6 Fixing bug
[#448679] Left to right

* Python/compile.c
  (com_dictmaker): Reordered evaluation of dictionaries to follow strict
  LTR evaluation.

* Lib/compiler/pycodegen.py
  (CodeGenerator.visitDict): Reordered evaluation of dictionaries to
  follow strict LTR evaluation.

* Doc/ref/ref5.tex
  Documented the general LTR evaluation order idea.

* Misc/NEWS
  Documented change in evaluation order of dictionaries.
2002-12-16 13:54:02 +00:00
Gustavo Niemeyer d5ae01a803 Applying patch
[#636769] Fix for major rexec bugs

* Lib/rexec.py
  (FileBase): Added 'xreadlines' and '__iter__' to allowed file methods.
  (FileWrapper.__init__): Removed unnecessary self.f variable, which gave
  direct access to the file object.
  (RExec): Added 'xreadlines' and '_weakref' to allowed modules.
  (RExec.r_open): Convert string subclasses to a real string classes
  before doing comparisons with mode parameter.

* Lib/ihooks.py
  (BasicModuleImporter.import_module/reload/unload): Convert the module
  name to a real string before working with it.
  (ModuleImporter.import_module/import_it/reload): Convert the module
  name to a real strings before working with it.

* Misc/NEWS
  Document the change.
2002-12-16 13:11:57 +00:00
Raymond Hettinger 866964c3a3 Apply SF patch 652930: Add optional base argument to math.log(x[, base]). 2002-12-14 19:51:34 +00:00
Thomas Heller 1b3b49d132 Mention the bdist_wininst postinstall script. 2002-12-12 19:13:44 +00:00
Marc-André Lemburg 20b91358e5 News item for the change to turn _codecs into a builtin module. 2002-12-12 18:01:43 +00:00
Walter Dörwald d9a6ad3beb Enhance issubclass() and PyObject_IsSubclass() so that a tuple is
supported as the second argument. This has the same meaning as
for isinstance(), i.e. issubclass(X, (A, B)) is equivalent
to issubclass(X, A) or issubclass(X, B). Compared to isinstance(),
this patch does not search the tuple recursively for classes, i.e.
any entry in the tuple that is not a class, will result in a
TypeError.

This closes SF patch #649608.
2002-12-12 16:41:44 +00:00
Raymond Hettinger ef8b9c6616 Docs were added about a month ago 2002-12-09 08:56:06 +00:00
Skip Montanaro 3bf99e3e87 Add support for binary pickles to the shelve module. In some situations
this can result in significantly smaller files.  All classes as well as the
open function now accept an optional binary parameter, which defaults to
False for backward compatibility.  Added a small test suite, updated the
libref documentation (including documenting the exported classes and fixing
a few other nits) and added a note about the change to Misc/NEWS.
2002-12-08 18:36:24 +00:00
Martin v. Löwis 79acb9edfa Patch #614055: Support OpenVMS. 2002-12-06 12:48:53 +00:00
Mark Hammond c3de008d62 _ssl.pyd added for Windows. 2002-12-03 06:16:08 +00:00
Just van Rossum 6a8c51837a The new imp.[gs]et_frozenmodules() will be utterly redundant if the
zipfile import stuff get in. I'll probably back it out again.
2002-12-01 21:43:13 +00:00
Just van Rossum 3eb166b49b Slightly improved version of patch #642578: "Expose PyImport_FrozenModules
in imp". This adds two functions to the imp module: get_frozenmodules()
and set_frozenmodules().
2002-11-29 20:47:40 +00:00
Guido van Rossum c0d3f4e445 Rephrase dict.fromkeys() news. 2002-11-27 13:10:40 +00:00
Raymond Hettinger e33d3df030 SF Patch 643443. Added dict.fromkeys(iterable, value=None), a class
method for constructing new dictionaries from sequences of keys.
2002-11-27 07:29:33 +00:00
Fred Drake 4dd0f7ef7a Add a way to say "use any resource except A". For example, to run
allow the use of any resource except bsddb, give the option
"-uall,-bsddb".
2002-11-26 21:44:56 +00:00
Martin v. Löwis 8c8aa5d666 Rename want_objects to wantobjects throughout, for consistency. 2002-11-26 21:39:48 +00:00