Commit Graph

1539 Commits

Author SHA1 Message Date
Guido van Rossum 41c99e7f96 SF patch #720991 by Gary Herron:
A small fix for bug #545855 and Greg Chapman's
addition of op code SRE_OP_MIN_REPEAT_ONE for
eliminating recursion on simple uses of pattern '*?' on a
long string.
2003-04-14 17:59:34 +00:00
Guido van Rossum efbbb1c602 Patch by Chad Netzer (with significant change):
- range() now works even if the arguments are longs with magnitude
  larger than sys.maxint, as long as the total length of the sequence
  fits.  E.g., range(2**100, 2**101, 2**100) is the following list:
  [1267650600228229401496703205376L].  (SF patch #707427.)
2003-04-11 18:43:06 +00:00
Jack Jansen de354b74f0 Added a note that the Mac OSA modules are documented. 2003-04-11 15:37:20 +00:00
Guido van Rossum f405064ccb - New function winsound.MessageBeep() wraps the Win32 API
MessageBeep().
2003-04-09 19:39:06 +00:00
Guido van Rossum a12fe4e81f - New function sys.call_tracing() allows pdb to debug code
recursively.
- pdb has a new command, "debug", which lets you step through
  arbitrary code from the debugger's (pdb) prompt.
2003-04-09 19:06:21 +00:00
Tim Peters 730f5535ba s/referrents/referents/g. Gotta love that referrers remains rife with rs. 2003-04-08 17:17:17 +00:00
Tim Peters 0f81ab6d88 Finished implementing gc.get_referrents(): dealt with error and end
cases, wrote docs, added a test.
2003-04-08 16:39:48 +00:00
Tim Peters f6b8045ca5 Reworked has_finalizer() to use the new _PyObject_Lookup() instead
of PyObject_HasAttr(); the former promises never to execute
arbitrary Python code.  Undid many of the changes recently made to
worm around the worst consequences of that PyObject_HasAttr() could
execute arbitrary Python code.

Compatibility is hard to discuss, because the dangerous cases are
so perverse, and much of this appears to rely on implementation
accidents.

To start with, using hasattr() to check for __del__ wasn't only
dangerous, in some cases it was wrong:  if an instance of an old-
style class didn't have "__del__" in its instance dict or in any
base class dict, but a getattr hook said __del__ existed, then
hasattr() said "yes, this object has a __del__".  But
instance_dealloc() ignores the possibility of getattr hooks when
looking for a __del__, so while object.__del__ succeeds, no
__del__ method is called when the object is deleted.  gc was
therefore incorrect in believing that the object had a finalizer.

The new method doesn't suffer that problem (like instance_dealloc(),
_PyObject_Lookup() doesn't believe __del__ exists in that case), but
does suffer a somewhat opposite-- and even more obscure --oddity:
if an instance of an old-style class doesn't have "__del__" in its
instance dict, and a base class does have "__del__" in its dict,
and the first base class with a "__del__" associates it with a
descriptor (an object with a __get__ method), *and* if that
descriptor raises an exception when __get__ is called, then
(a) the current method believes the instance does have a __del__,
but (b) hasattr() does not believe the instance has a __del__.

While these disagree, I believe the new method is "more correct":
because the descriptor *will* be called when the object is
destructed, it can execute arbitrary Python code at the time the
object is destructed, and that's really what gc means by "has a
finalizer":  not specifically a __del__ method, but more generally
the possibility of executing arbitrary Python code at object
destruction time.  Code in a descriptor's __get__() executed at
destruction time can be just as problematic as code in a
__del__() executed then.

So I believe the new method is better on all counts.

Bugfix candidate, but it's unclear to me how all this differs in
the 2.2 branch (e.g., new-style and old-style classes already
took different gc paths in 2.3 before this last round of patches,
but don't in the 2.2 branch).
2003-04-07 19:21:15 +00:00
Raymond Hettinger c377cbfdaf SF bug #715145: unittest.py still uses != in failUnlessEqual 2003-04-04 22:56:42 +00:00
Martin v. Löwis 7fb697b5d2 Revert Patch #670715: iconv support. 2003-04-03 04:49:12 +00:00
Walter Dörwald 1e469c5603 Fix description: u"%c" % 0xffffffff returned a ValueError not a TypeError. 2003-04-02 16:57:59 +00:00
Walter Dörwald 44f527fea4 Change formatchar(), so that u"%c" % 0xffffffff now raises
an OverflowError instead of a TypeError to be consistent
with "%c" % 256. See SF patch #710127.
2003-04-02 16:37:24 +00:00
Jack Jansen a02b7a8f6d Added a note about scripting support and the IDE builtin help. 2003-04-01 22:33:37 +00:00
Walter Dörwald 43440a621e Fix PyString_Format() so that '%c' % u'a' returns u'a'
instead of raising a TypeError. (From SF patch #710127)

Add tests to verify this is fixed.

Add various tests for '%c' % int.
2003-03-31 18:07:50 +00:00
Walter Dörwald fa86bf5b81 Fix typo. 2003-03-31 16:15:13 +00:00
Martin v. Löwis 3163a3b4b2 Patch #545300: Support marked sections. 2003-03-30 14:25:40 +00:00
Skip Montanaro 89feabc7f5 The socket module now always uses the _socketobject wrapper class, even on
platforms which have dup(2).  The makefile() method is built directly on top
of the socket without duplicating the file descriptor, allowing timeouts to
work properly.  Includes a new test case (urllibnet) which requires the
network resource.

Closes bug 707074.
2003-03-30 04:54:24 +00:00
Martin v. Löwis b9a0f91218 Rename LONG_LONG to PY_LONG_LONG. Fixes #710285. 2003-03-29 10:06:18 +00:00
Walter Dörwald 11cfbd6ef2 Fix typo. 2003-03-26 16:03:16 +00:00
Jack Jansen 49754af873 Frank Vercruesse gave an okay on removing the copyright notice:
"Hereby I make the script in question available under the terms and
conditions of the latest Python License."
2003-03-25 10:20:55 +00:00
Jack Jansen cf76be0ae0 Added a Mac note that EasyDialogs dialogs now bring the application to
the foreground.
2003-03-24 12:13:54 +00:00
Tim Peters 78be7993b6 When Py_TRACE_REFS is defined, a list of all live objects is maintained in
a doubly-linked list, exposed by sys.getobjects().  Unfortunately, it's not
really all live objects, and it seems my fate to bump into programs where
sys.gettotalrefcount() keeps going up but where the reference leaks aren't
accounted for by anything in the list of all objects.

This patch helps a little:  if COUNT_ALLOCS is also defined, from now on
type objects will also appear in this list, provided at least one object
of a type has been allocated.
2003-03-23 02:51:01 +00:00
Skip Montanaro a0b3e6d191 add several people involved with PEP 305 and the csv package 2003-03-20 23:41:03 +00:00
Skip Montanaro 64a839eb71 announce csv package 2003-03-20 23:36:55 +00:00
Tim Peters d50ade68ec SF bug 705836: struct.pack of floats in non-native endian order
pack_float, pack_double, save_float:  All the routines for creating
IEEE-format packed representations of floats and doubles simply ignored
that rounding can (in rare cases) propagate out of a long string of
1 bits.  At worst, the end-off carry can (by mistake) interfere with
the exponent value, and then unpacking yields a result wrong by a factor
of 2.  In less severe cases, it can end up losing more low-order bits
than intended, or fail to catch overflow *caused* by rounding.

Bugfix candidate, but I already backported this to 2.2.

In 2.3, this code remains in severe need of refactoring.
2003-03-20 18:32:13 +00:00
Gustavo Niemeyer 5ddd4c3f77 Fixed SF bug #663074. The codec system was using global static
variables to store internal data. As a result, any atempts to use the
unicode system with multiple active interpreters, or successive
interpreter executions, would fail.

Now that information is stored into members of the PyInterpreterState
structure.
2003-03-19 00:35:36 +00:00
Raymond Hettinger 1da1dbf458 Renamed PyObject_GenericGetIter to PyObject_SelfIter
to more accurately describe what the function does.

Suggested by Thomas Wouters.
2003-03-17 19:46:11 +00:00
Thomas Wouters dcf6d2c97d Add Hye-Shik Chang for SF patch/bugreport #703471. 2003-03-17 11:34:01 +00:00
Raymond Hettinger 0153826964 Created PyObject_GenericGetIter().
Factors out the common case of returning self.
2003-03-17 08:24:35 +00:00
Guido van Rossum d11b62edd0 - New function time.tzset() provides access to the C library tzet()
function, if supported.  (SF patch #675422, by Stuart Bishop.)
2003-03-14 21:51:36 +00:00
Michael W. Hudson 43ed43bfc1 Take out my (long since disabled) POSIX signal mask handling code.
I'm not going to have the time or energy to get this working x-platform
-- anyone who does is welcome to the code!
2003-03-13 13:56:53 +00:00
Raymond Hettinger d65ec37f46 Fix spelling. 2003-03-11 21:43:55 +00:00
Raymond Hettinger 2c2d322884 SF patch #667730: More DictMixin
* Adds missing pop() methods to weakref.py
* Expands test suite to broaden coverage of objects with
  a mapping interface.

Contributed by Sebastien Keim.
2003-03-09 07:05:43 +00:00
Raymond Hettinger 42182ebaf6 SF 698520: Iterator for urllib.URLOpener
Contributed by Brett Cannon.
2003-03-09 05:33:33 +00:00
Guido van Rossum e5c691abe3 - The extended type structure used for heap types (new-style
classes defined by Python code using a class statement) is now
  exported from object.h as PyHeapTypeObject.  (SF patch #696193.)
2003-03-07 15:13:17 +00:00
Raymond Hettinger a3e1e4cd79 SF patch #693753: fix for bug 639806: default for dict.pop
(contributed by Michael Stone.)
2003-03-06 23:54:28 +00:00
Guido van Rossum 9589a25220 Mention timeit.py. 2003-03-06 01:56:12 +00:00
Martin v. Löwis 73d538b9c6 Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,
and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding.
Adjust test case.
2003-03-05 15:13:47 +00:00
Neal Norwitz 12e2217501 Fix SF #692416, don't crash interpreter for _tkinter.deletefilehandler
in addition to createfilehandler and creaetetimerhandler.
2003-03-03 21:16:39 +00:00
Just van Rossum 96b1c903f5 Patch #683592 revisited, after discussions with MvL:
- Implement the behavior as specified in PEP 277, meaning os.listdir()
  will only return unicode strings if it is _called_ with a unicode
  argument.
- And then return only unicode, don't attempt to convert to ASCII.
- Don't switch on Py_FileSystemDefaultEncoding, but simply use the
  default encoding if Py_FileSystemDefaultEncoding is NULL. This means
  os.listdir() can now raise UnicodeDecodeError if the default encoding
  can't represent the directory entry. (This seems better than silcencing
  the error and fall back to a byte string.)
- Attempted to decribe the above in Doc/lib/libos.tex.
- Reworded the Misc/NEWS items to reflect the current situation.

This checkin also fixes bug #696261, which was due to os.listdir() not
using Py_FileSystemDefaultEncoding, like all file system calls are
supposed to.
2003-03-03 17:32:15 +00:00
Ken Manheimer ed6000a993 py-pdbtrack-grub-for-buffer(): Rectified some logic errors i
introduced when shifting around some code, and added some redundancy
to reduce chances of hitting the wrong source code.  (This is
experimental - it will improve the accuracy, but will reduce the
ability of the user to deliberately select the buffer they want the
buffer grubbing stuff to find.  I think the accuracy improvement will
be worth it, but am not sure, so may remove this.)
2003-03-03 17:09:44 +00:00
Michael W. Hudson f008998668 Fix bug
[ 555817 ] Flawed fcntl.ioctl implementation.

with my patch that allows for an array to be mutated when passed
as the buffer argument to ioctl() (details complicated by
backwards compatibility considerations -- read the docs!).
2003-03-03 12:29:42 +00:00
Ken Manheimer ad428cd1cd Guard advancing past leading meta-comments. 2003-03-03 04:05:03 +00:00
Ken Manheimer e7aca521db Enhanced pdbtrack to provide for source code that's not findable by
the reported path.  (Eg, precompiled scripts with a file path suitable
for a different host, scripts actually running on a remote system or
with no valid path, like Zope through-the-web python scripts.)

On failing to find the code on the reported path, pdbtrack takes the
function name and looks through the buffers, from most to least
recent, seeking the first python-mode buffer that either is named for
the function or has a definition (def or class) for that function.  So
to get source tracking for code that's not located where the path
indicates, you put a copy of the script in a buffer, and pdbtrack will
find it.

Also, fixed a small bug so pdbtrack now properly presents the overlay
arrow when you run the pdb 'w'here command.
2003-03-03 00:35:32 +00:00
Tim Peters 44f14b0399 SF bug 693121: Set == non-Set is a TypeError.
Allow mixed-type __eq__ and __ne__ for Set objects.  This is messier than
I'd like because Set *also* implements __cmp__.  I know of one glitch now:
cmp(s, t) returns 0 now when s and t are both Sets and s == t, despite
that Set.__cmp__ unconditionally raises TypeError (and by intent).  The
rub is that __eq__ gets tried first, and the x.__eq__(y) True result
convinces Python that cmp(x, y) is 0 without even calling Set.__cmp__.
2003-03-02 00:19:49 +00:00
Guido van Rossum 46d3dc37e4 - New function sys.exc_clear() clears the current exception. This is
rarely needed, but can sometimes be useful to release objects
  referenced by the traceback held in sys.exc_info()[2].  (SF patch
  #693195.)  Thanks to Kevin Jacobs!
2003-03-01 03:20:41 +00:00
Andrew M. Kuchling 6f177d434f Add news item for patch #695090 2003-02-28 22:09:33 +00:00
Neal Norwitz 55b61d21d8 Fix SF bugs #692951 and 692988, test_timeout.py needs 'network' resource
require -u network to run test_timeout since
it fails when not connected to a network.
2003-02-28 19:57:03 +00:00
Neal Norwitz 2c92c6e1f4 Fix SF bug #690012 2003-02-28 17:24:00 +00:00
Jack Jansen 4213e27616 Added a note about EasyDialogs dialogs having become movable. 2003-02-27 22:52:58 +00:00
Just van Rossum 46c9784f68 Patch #683592: unicode support for os.listdir()
os.listdir() may now return unicode strings on platforms that set
Py_FileSystemDefaultEncoding.
2003-02-25 21:42:15 +00:00
Skip Montanaro 12fe72e9df note the demise of the dospath module (was actually in 2.3a2) 2003-02-25 17:46:20 +00:00
Guido van Rossum 0f69833396 2.3b1 patches 2003-02-24 17:55:37 +00:00
Jack Jansen deac2acdb8 Added a note about MacOS.WMAvailable(). 2003-02-24 11:04:17 +00:00
Guido van Rossum 902a671c7b Deleting the 2.2 spec. 2003-02-24 01:12:54 +00:00
Guido van Rossum 2ef777fd82 RPM spec file for 2.3a2, contributed by Sean Reifschneider. 2003-02-24 01:09:53 +00:00
Neal Norwitz 35892b9ad9 Fix SF bug #691793, Python 2.3a2 build fails on Tru64 2003-02-23 23:45:35 +00:00
Neal Norwitz d5a65a77cf Fix SF bug #689659, 64-bit int and long hash keys incompatible
On a 64-bit machine, a dictionary could contain duplicate int/long keys
if the value was > 2**32.
2003-02-23 23:11:41 +00:00
Raymond Hettinger 61fe64d5de User requested changes to the itertools module.
Subsumed times() into repeat().
Added cycle() and chain().
2003-02-23 04:40:07 +00:00
Guido van Rossum 351a7dd64a Prepped for 2.3b1.
Added an extra blank line before "What's New in Python 2.2 final?".
2003-02-20 01:56:17 +00:00
Guido van Rossum 16c8517988 Match parentheses. 2003-02-20 01:52:48 +00:00
Guido van Rossum a003290da5 Merge in changes made to the 2.3a2 release. 2003-02-20 01:38:31 +00:00
David Goodger dd83cce8ea fixed markup 2003-02-19 23:31:51 +00:00
Guido van Rossum 22e2f73d91 Update versions/dates for release of 2.3a2. Added some last-minute news. 2003-02-19 18:18:47 +00:00
Walter Dörwald 2ffec02b48 Add a note about the recent PEP 293 changes. 2003-02-19 16:34:11 +00:00
Guido van Rossum 6297a7a9fb - PyEval_GetFrame() is now declared to return a PyFrameObject *
instead of a plain PyObject *.  (SF patch #686601 by Ben Laurie.)
2003-02-19 15:53:17 +00:00
Guido van Rossum 162e38c6a3 - sys.path[0] (the directory from which the script is loaded) is now
turned into an absolute pathname, unless it is the empty string.
  (SF patch #664376, by Skip Montanaro.)
2003-02-19 15:25:10 +00:00
Jack Jansen 5d44b347c9 Added a note that MacOSX applets can no longer be run from a terminal window. 2003-02-18 23:32:47 +00:00
Guido van Rossum 6921eca227 Make PyNumber_Check() a bit more careful, since all sorts of things
now have tp_as_number.  Check for nb_int or nb_float.
2003-02-18 16:36:28 +00:00
Michael W. Hudson 9e5d87fa20 Reword section about moving variables to os.path to match intent (or
at least, what I thought the intent was).
2003-02-17 12:26:23 +00:00
Andrew MacIntyre 251b816297 Patch 686397:
move definition of platform dependent path related variables from os.py
to platform dependent path modules (ntpath, etc).
2003-02-17 09:20:23 +00:00
Jack Jansen 9f70aabbf8 Added notes about pimp and bundlebuilder to the Mac section. 2003-02-16 23:00:53 +00:00
Guido van Rossum 4507ec70cf - The audio driver tests (test_ossaudiodev.py and
test_linuxaudiodev.py) are no longer run by default.  This is
  because they don't always work, depending on your hardware and
  software.  To run these tests, you must use an invocation like
    ./python Lib/test/regrtest.py -u audio test_ossaudiodev
2003-02-14 19:29:22 +00:00
Guido van Rossum 1442dc1194 Add SF reference to news item. 2003-02-13 22:19:20 +00:00
Guido van Rossum 4b499dd3fb - Finally fixed the bug in compile() and exec where a string ending
with an indented code block but no newline would raise SyntaxError.
  This would have been a four-line change in parsetok.c...  Except
  codeop.py depends on this behavior, so a compilation flag had to be
  invented that causes the tokenizer to revert to the old behavior;
  this required extra changes to 2 .h files, 2 .c files, and 2 .py
  files.  (Fixes SF bug #501622.)
2003-02-13 22:07:59 +00:00
Guido van Rossum 298e421453 SF patch #685738 by Michael Stone.
This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.
2003-02-13 16:30:16 +00:00
Guido van Rossum c4f4ca91e1 Provide access to the import lock, fixing SF bug #580952. This is
mostly from SF patch #683257, but I had to change unlock_import() to
return an error value to avoid fatal error.

Should this be backported?  The patch requested this, but it's a new
feature.
2003-02-12 21:46:11 +00:00
Guido van Rossum 47710656e5 Issue a warning when int('0...', 0) returns an int with the sign
folded; this will change in Python 2.4.  On a 32-bit machine, this
happens for 0x80000000 through 0xffffffff, and for octal constants in
the same value range.  No warning is issued if an explicit base is
given, *or* if the string contains a sign (since in those cases no
sign folding ever happens).
2003-02-12 20:48:22 +00:00
Guido van Rossum 48035eb452 SF #660455 : patch by NNorwitz.
"Unsigned" (i.e., positive-looking, but really negative) hex/oct
constants with a leading minus sign are once again properly negated.
The micro-optimization for negated numeric constants did the wrong
thing for such hex/oct constants.  The patch avoids the optimization
for all hex/oct constants.

This needs to be backported to Python 2.2!
2003-02-12 17:05:26 +00:00
Guido van Rossum a89d10edc9 Implement another useful feature for proxies: in super(X, x), x may
now be a proxy for an X instance, as long as issubclass(x.__class__, X).
2003-02-12 03:58:38 +00:00
Guido van Rossum 03bc7d3c4d SF #532767: isinstance(x, X) should work when x is a proxy for an X
instance, as long as x.__class__ is X or a subclass thereof.
Did a little cleanup of PyObject_IsInstance() too.
2003-02-12 03:32:58 +00:00
Guido van Rossum eea4718e81 Fix from SF #681367: inherit tp_as_buffer. This only applies to C
types -- Python types already inherited this.
2003-02-11 20:39:59 +00:00
Just van Rossum e1ebd80b04 mention unicode file name support on OSX 2003-02-10 10:06:18 +00:00
Just van Rossum 73ffb4aa4e mention unicode support in compile, eval and exec 2003-02-10 09:57:08 +00:00
Neal Norwitz de8b94c3e1 Fix SF bug #683467, 'int' ability to generate longs not inherited
When subclassing from an int but not overriding __new__,
long values were not converted properly.  Try to convert
longs into an int.
2003-02-10 02:12:43 +00:00
Neal Norwitz 9caf9c040e Add tests and news entry about parser errors from bug #678518. 2003-02-10 01:54:06 +00:00
Neal Norwitz 573e033488 Alphabetize some names
Add Grant Olson for patch provided to fix bug #678518
2003-02-10 01:09:49 +00:00
Tim Peters 07534a607b Comparison for timedelta, time, date and datetime objects: __eq__ and
__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().
2003-02-07 22:50:28 +00:00
Jack Jansen c929636bc2 Added a note about getting rid of macfs usage (MacPython). 2003-02-06 23:10:45 +00:00
Guido van Rossum 26507dbc82 Clarify that __module__ applies to various type of functions. 2003-02-06 16:16:50 +00:00
Jeremy Hylton 0253d6eff1 Add news item about __module__ attribute on functions. 2003-02-06 16:00:15 +00:00
Jeremy Hylton 985eba53f5 Small function call optimization and special build option for call stats.
-DCALL_PROFILE: Count the number of function calls executed.

When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made.  It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.

Optimization:

When we take the fast_function() path, which seems to be taken for
most function calls, and there is minimal frame setup to do, avoid
call PyEval_EvalCodeEx().  The eval code ex function does a lot of
work to handle keywords args and star args, free variables,
generators, etc.  The inlined version simply allocates the frame and
copies the arguments values into the frame.

The optimization gets a little help from compile.c which adds a
CO_NOFREE flag to code objects that don't have free variables or cell
variables.  This change allows fast_function() to get into the fast
path with fewer tests.

I measure a couple of percent speedup in pystone with this change, but
there's surely more that can be done.
2003-02-05 23:13:00 +00:00
Tim Peters 6ee0480521 [680789] Debug with long array takes forever
Added array.array to the types repr.py knows about, after a suggestion
from Jurjen N.E. Bos.
2003-02-05 18:29:34 +00:00
Neil Schemenauer 5042da6b1e If a float is passed where a int is expected, issue a DeprecationWarning
instead of raising a TypeError.  Closes #660144 (again).
2003-02-04 20:59:40 +00:00
Walter Dörwald 28d81966c9 Fix typo. 2003-02-03 20:53:14 +00:00
Guido van Rossum 7d9ea5013f - Thanks to Scott David Daniels, a subtle bug in how the zlib
extension implemented flush() was fixed.  Scott also rewrite the
  zlib test suite using the unittest module.  (SF bug #640230 and
  patch #678531.)

Backport candidate I think.
2003-02-03 20:45:52 +00:00
Skip Montanaro 621f055233 braino 2003-02-03 15:48:10 +00:00
Skip Montanaro 13b291021f add note about new db2pickle.py and pickle2db.py scripts 2003-02-03 15:17:25 +00:00
Neal Norwitz 6c54ef6884 Add some notes that got python to work on the snake farm 2003-02-02 17:10:04 +00:00
Tim Peters bf2674be0e long(string, base) now takes time linear in len(string) when base is a
power of 2.  Enabled the tail end of test_long() in pickletester.py
because it no longer takes forever when run from test_pickle.py.
2003-02-02 07:51:32 +00:00
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