]> granicus.if.org Git - python/log
python
21 years agoAdd cPickle support for PROTO. Duplicated PROTO/LONG1/LONG4 code in
Tim Peters [Sun, 2 Feb 2003 16:09:05 +0000 (16:09 +0000)]
Add cPickle support for PROTO.  Duplicated PROTO/LONG1/LONG4 code in
the hitherto unknown (to me) noload() cPickle function, which is (a)
something we don't test at all, and (b) pickle.py doesn't have.

21 years agoOne more use of ifilter()
Raymond Hettinger [Sun, 2 Feb 2003 16:07:53 +0000 (16:07 +0000)]
One more use of ifilter()

21 years agoSF patch #678899: Save time and memory by using itertools in sets module.
Raymond Hettinger [Sun, 2 Feb 2003 14:27:19 +0000 (14:27 +0000)]
SF patch #678899:  Save time and memory by using itertools in sets module.

21 years agoTightened a too-generous assert.
Tim Peters [Sun, 2 Feb 2003 08:05:32 +0000 (08:05 +0000)]
Tightened a too-generous assert.

21 years agolong(string, base) now takes time linear in len(string) when base is a
Tim Peters [Sun, 2 Feb 2003 07:51:32 +0000 (07:51 +0000)]
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.

21 years agoFix memory leak: free memory storing the content model passed to the
Fred Drake [Sun, 2 Feb 2003 03:54:17 +0000 (03:54 +0000)]
Fix memory leak: free memory storing the content model passed to the
ElementDeclHandler by Expat.
Fixes SF bug #676990.

21 years agocPickle.c: Full support for the new LONG1 and LONG4. Added comments.
Tim Peters [Sun, 2 Feb 2003 02:57:53 +0000 (02:57 +0000)]
cPickle.c:  Full support for the new LONG1 and LONG4.  Added comments.
Assorted code cleanups; e.g., sizeof(char) is 1 by definition, so there's
no need to do things like multiply by sizeof(char) in hairy malloc
arguments.  Fixed an undetected-overflow bug in readline_file().

longobject.c:  Fixed a really stupid bug in the new _PyLong_NumBits.

pickle.py:  Fixed stupid bug in save_long():  When proto is 2, it
wrote LONG1 or LONG4, but forgot to return then -- it went on to
append the proto 1 LONG opcode too.
Fixed equally stupid cancelling bugs in load_long1() and
load_long4():  they *returned* the unpickled long instead of pushing
it on the stack.  The return values were ignored.  Tests passed
before only because save_long() pickled the long twice.

Fixed bugs in encode_long().

Noted that decode_long() is quadratic-time despite our hopes,
because long(string, 16) is still quadratic-time in len(string).
It's hex() that's linear-time.  I don't know a way to make decode_long()
linear-time in Python, short of maybe transforming the 256's-complement
bytes into marshal's funky internal format, and letting marshal decode
that.  It would be more valuable to make long(string, 16) linear time.

pickletester.py:  Added a global "protocols" vector so tests can try
all the protocols in a sane way.  Changed test_ints() and test_unicode()
to do so.  Added a new test_long(), but the tail end of it is disabled
because it "takes forever" under pickle.py (but runs very quickly under
cPickle:  cPickle proto 2 for longs is linear-time).

21 years agoThe C pickle now knows how to deal with a proto= argument. Assorted
Tim Peters [Sat, 1 Feb 2003 16:45:06 +0000 (16:45 +0000)]
The C pickle now knows how to deal with a proto= argument.  Assorted
code cleanups, and purged more references to text-vs-binary modes.

21 years agoremoved bizarre construct, no idea why it was there...
Just van Rossum [Sat, 1 Feb 2003 10:29:45 +0000 (10:29 +0000)]
removed bizarre construct, no idea why it was there...

21 years agopatch #678211 from Robin Dunn
Just van Rossum [Sat, 1 Feb 2003 10:07:28 +0000 (10:07 +0000)]
patch #678211 from Robin Dunn

21 years agoicon support by Robin Dunn, closes patch #678218
Just van Rossum [Sat, 1 Feb 2003 08:34:46 +0000 (08:34 +0000)]
icon support by Robin Dunn, closes patch #678218

21 years agoRemoved needless include of errno.h.
Tim Peters [Sat, 1 Feb 2003 06:30:12 +0000 (06:30 +0000)]
Removed needless include of errno.h.

21 years agoThe module docstring had an RCS ID from 1999 embedded in it. Enough
Tim Peters [Sat, 1 Feb 2003 06:27:59 +0000 (06:27 +0000)]
The module docstring had an RCS ID from 1999 embedded in it.  Enough
already <wink>.

21 years agoTrimmed trailing whitespace.
Tim Peters [Sat, 1 Feb 2003 06:24:36 +0000 (06:24 +0000)]
Trimmed trailing whitespace.

21 years agoAdded #defines for proto 2 opcodes; gave the Pickler a proto member;
Tim Peters [Sat, 1 Feb 2003 06:22:36 +0000 (06:22 +0000)]
Added #defines for proto 2 opcodes; gave the Pickler a proto member;
removed woefully inadequate opcode docs and pointed to pickletools.py
instead.

21 years agoNew functions alloc_{time,datetime}. Got rid of all setstate-like
Tim Peters [Sat, 1 Feb 2003 04:40:04 +0000 (04:40 +0000)]
New functions alloc_{time,datetime}.  Got rid of all setstate-like
functions.  Reworked {time,datetime}_new() to do what their corresponding
setstates used to do in their state-tuple-input paths, but directly,
without constructing an object with throwaway state first.  Tightened
the "is this a state tuple input?" paths to check the presumed state
string-length too, and to raise an exception if the optional second state
element isn't a tzinfo instance (IOW, check these paths for type errors
as carefully as the normal paths).

21 years agoThere's no good reason for datetime objects to expose __getstate__()
Tim Peters [Sat, 1 Feb 2003 02:54:15 +0000 (02:54 +0000)]
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!).

21 years agoNeaten ref count test.
Raymond Hettinger [Sat, 1 Feb 2003 02:33:45 +0000 (02:33 +0000)]
Neaten ref count test.

21 years agoRemoved all uses of the out-of-favor __safe_for_unpickling__ magic
Tim Peters [Sat, 1 Feb 2003 02:16:37 +0000 (02:16 +0000)]
Removed all uses of the out-of-favor __safe_for_unpickling__ magic
attr, and copy_reg.safe_constructors.

21 years agoAll over: changed comments to reflect pickling is straightforward now,
Tim Peters [Sat, 1 Feb 2003 01:52:50 +0000 (01:52 +0000)]
All over:  changed comments to reflect pickling is straightforward now,
not the maze it was.

21 years agodelta_setstate(): This waS no longer referenced, so nukeit.
Tim Peters [Sat, 1 Feb 2003 01:47:29 +0000 (01:47 +0000)]
delta_setstate():  This waS no longer referenced, so nukeit.
delta_reduce():  Simplified.

21 years agoMove itertools module from the sandbox and into production.
Raymond Hettinger [Sat, 1 Feb 2003 00:10:11 +0000 (00:10 +0000)]
Move itertools module from the sandbox and into production.

21 years agoThe various datetime object __setstate__() methods are no longer public
Tim Peters [Fri, 31 Jan 2003 22:27:17 +0000 (22:27 +0000)]
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.

21 years agoChanged the tests to stop using __setstate__(). __setstate__() no
Tim Peters [Fri, 31 Jan 2003 21:55:33 +0000 (21:55 +0000)]
Changed the tests to stop using __setstate__().  __setstate__() no
longer needs to be public, and shoudn't be public because all datetime
objects are immutable.  The Python implementation has changed
accordingly, but still need to change the C implementation.

21 years agoSquash compiler wng about signed/unsigned comparison mismatch.
Tim Peters [Fri, 31 Jan 2003 21:45:13 +0000 (21:45 +0000)]
Squash compiler wng about signed/unsigned comparison mismatch.

21 years agoIgnore the state returned by __reduce__ if it is Py_None.
Guido van Rossum [Fri, 31 Jan 2003 21:10:31 +0000 (21:10 +0000)]
Ignore the state returned by __reduce__ if it is Py_None.

21 years agoPatch #669198: Add cflags to RC compile.
Thomas Heller [Fri, 31 Jan 2003 20:45:41 +0000 (20:45 +0000)]
Patch #669198: Add cflags to RC compile.

21 years agoPass the preprocessor options also to the resource compiler
Thomas Heller [Fri, 31 Jan 2003 20:40:15 +0000 (20:40 +0000)]
Pass the preprocessor options also to the resource compiler
when compiling .RC files.

From Robin Dunn, fixes SF # 669198.

21 years agoAdd extension management to __all__.
Guido van Rossum [Fri, 31 Jan 2003 20:34:07 +0000 (20:34 +0000)]
Add extension management to __all__.

21 years agoChange the default protocol back to 0.
Guido van Rossum [Fri, 31 Jan 2003 19:42:31 +0000 (19:42 +0000)]
Change the default protocol back to 0.
Add a feature suggested by Tim: a negative protocol value means to use
the largest protocol value supported.

21 years agoAnother extension to reduce(). It can return a 4- or 5-tuple now.
Guido van Rossum [Fri, 31 Jan 2003 18:53:21 +0000 (18:53 +0000)]
Another extension to reduce().  It can return a 4- or 5-tuple now.
The 4th item can be None or an iterator yielding list items, which are
used to append() or extend() the object.  The 5th item can be None or
an iterator yielding a dict's (key, value) pairs, which are stuffed
into the object using __setitem__.

Also (as a separate, though related, feature) add "batching" for list
and dict items.  If you pickled a dict or list with a million items in
the past, it would push a million items onto the stack.  It now pushes
only 1000 items at a time on the stack, using repeated APPENDS or
SETITEMS opcodes.  (For lists, I hope that using many short extend()
calls doesn't exhibit quadratic behavior.)

21 years agoDocument __module__.
Jeremy Hylton [Fri, 31 Jan 2003 18:52:45 +0000 (18:52 +0000)]
Document __module__.

21 years agoProvide __module__ attributes for functions defined in C and Python.
Jeremy Hylton [Fri, 31 Jan 2003 18:33:18 +0000 (18:33 +0000)]
Provide __module__ attributes for functions defined in C and Python.

__module__ is the string name of the module the function was defined
in, just like __module__ of classes.  In some cases, particularly for
C functions, the __module__ may be None.

Change PyCFunction_New() from a function to a macro, but keep an
unused copy of the function around so that we don't change the binary
API.

Change pickle's save_global() to use whichmodule() if __module__ is
None, but add the __module__ logic to whichmodule() since it might be
used outside of pickle.

21 years agoSF patch #678257 by Geoff Talvola.
Guido van Rossum [Fri, 31 Jan 2003 18:15:58 +0000 (18:15 +0000)]
SF patch #678257 by Geoff Talvola.

In sendall(), do an internal select before each send() call, instead
of only for the first one.

21 years agoSF patch 676472 by Geoff Talvola, reviewed by Ben Laurie.
Guido van Rossum [Fri, 31 Jan 2003 18:13:18 +0000 (18:13 +0000)]
SF patch 676472 by Geoff Talvola, reviewed by Ben Laurie.

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.

21 years agoI believe this fixes
Michael W. Hudson [Fri, 31 Jan 2003 17:48:29 +0000 (17:48 +0000)]
I believe this fixes

[ 669692 ] pdb user_call breakage

What an odd interface!  I guess I should have read the docstring, though.

21 years agoChange the treatment of positions returned by PEP293
Walter Dörwald [Fri, 31 Jan 2003 17:19:08 +0000 (17:19 +0000)]
Change the treatment of positions returned by PEP293
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.

21 years agoPass the object to save_reduce(), so the memoize() call can go into
Guido van Rossum [Fri, 31 Jan 2003 17:17:49 +0000 (17:17 +0000)]
Pass the object to save_reduce(), so the memoize() call can go into
save_reduce(), before the state is pickled.  This makes it possible
for an object to be referenced from its own (mutable) state.

21 years agoAdd a magical feature to save_reduce so that __reduce__ can cause
Guido van Rossum [Fri, 31 Jan 2003 16:51:45 +0000 (16:51 +0000)]
Add a magical feature to save_reduce so that __reduce__ can cause
NEWOBJ to be generated.

21 years agoIt's Official: for LONG1/LONG4, a "byte count" of 0 is taken as a
Tim Peters [Fri, 31 Jan 2003 16:43:39 +0000 (16:43 +0000)]
It's Official:  for LONG1/LONG4, a "byte count" of 0 is taken as a
shortcut meaning 0L.  This allows LONG1 to encode 0L in two bytes
total.

21 years agoInitialize swappedinput to silence the compiler warning about
Walter Dörwald [Fri, 31 Jan 2003 16:26:50 +0000 (16:26 +0000)]
Initialize swappedinput to silence the compiler warning about
uninitialized variables.

21 years agoMake StringIO its own iterator, similar to real files.
Guido van Rossum [Fri, 31 Jan 2003 16:04:15 +0000 (16:04 +0000)]
Make StringIO its own iterator, similar to real files.

(This should also be done to cStringIO.)

21 years ago_PyLong_NumBits(): The definition of this was too specific to the quirky
Tim Peters [Fri, 31 Jan 2003 15:52:05 +0000 (15:52 +0000)]
_PyLong_NumBits():  The definition of this was too specific to the quirky
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.

21 years agoFix typo
Raymond Hettinger [Fri, 31 Jan 2003 05:44:25 +0000 (05:44 +0000)]
Fix typo

21 years agoSF bug #671447: StringIO doc doesn't say it's sometimes read-only.
Raymond Hettinger [Fri, 31 Jan 2003 05:17:33 +0000 (05:17 +0000)]
SF bug #671447: StringIO doc doesn't say it's sometimes read-only.

21 years agoM PyShell.py
Kurt B. Kaiser [Fri, 31 Jan 2003 05:06:43 +0000 (05:06 +0000)]
M PyShell.py
M rpc.py

SF Bug 676398 Doesn't handle non-built-in exceptions
1. Move exception formatting to the subprocess; allows subclassing of
   exceptions, including subclasses created in the shell without
   introducing excessive complexity in the RPC mechanism.
2. Provide access to linecache from subprocess to support this.

21 years agoFix typo
Neal Norwitz [Fri, 31 Jan 2003 04:04:23 +0000 (04:04 +0000)]
Fix typo

21 years agoLinear-time implementations of {encode,decode}_long.
Tim Peters [Fri, 31 Jan 2003 03:43:58 +0000 (03:43 +0000)]
Linear-time implementations of {encode,decode}_long.

21 years agotypo in comment
Barry Warsaw [Fri, 31 Jan 2003 03:30:09 +0000 (03:30 +0000)]
typo in comment

21 years agoBackward branches are disgusting, at least when a forward branch
Tim Peters [Fri, 31 Jan 2003 01:37:35 +0000 (01:37 +0000)]
Backward branches are disgusting, at least when a forward branch
is just as easy.

21 years agoGive people who run "pydoc re" a clue.
Neil Schemenauer [Fri, 31 Jan 2003 00:35:58 +0000 (00:35 +0000)]
Give people who run "pydoc re" a clue.

21 years agoFix markup error.
Fred Drake [Thu, 30 Jan 2003 22:22:59 +0000 (22:22 +0000)]
Fix markup error.

21 years agoChange the approach to pickling to use __reduce__ everywhere. Most
Guido van Rossum [Thu, 30 Jan 2003 22:06:23 +0000 (22:06 +0000)]
Change the approach to pickling to use __reduce__ everywhere.  Most
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.

21 years agopickle.py has a few doctest'ed internal functions, so run their tests.
Tim Peters [Thu, 30 Jan 2003 21:27:37 +0000 (21:27 +0000)]
pickle.py has a few doctest'ed internal functions, so run their tests.

21 years agoCheck whether the choosen encoding requires byte swapping
Walter Dörwald [Thu, 30 Jan 2003 19:55:28 +0000 (19:55 +0000)]
Check whether the choosen encoding requires byte swapping
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)

21 years agoUpdated the INST/OBJ docs, to say they really are (almost) identical
Tim Peters [Thu, 30 Jan 2003 16:35:08 +0000 (16:35 +0000)]
Updated the INST/OBJ docs, to say they really are (almost) identical
in 2.3.

21 years agoload_inst(), load_obj(): Put the bulk of these into a common new
Tim Peters [Thu, 30 Jan 2003 15:41:46 +0000 (15:41 +0000)]
load_inst(), load_obj():  Put the bulk of these into a common new
_instantiate() method.

21 years agoStyle consistency, so "grep ^function ..." works as expected.
Fred Drake [Thu, 30 Jan 2003 15:08:25 +0000 (15:08 +0000)]
Style consistency, so "grep ^function ..." works as expected.

21 years agodis(): Simplified stack emulation a bit.
Tim Peters [Thu, 30 Jan 2003 15:02:12 +0000 (15:02 +0000)]
dis():  Simplified stack emulation a bit.

21 years agoI was in this module anyway, so I did some janitorial things.
Michael W. Hudson [Thu, 30 Jan 2003 14:17:16 +0000 (14:17 +0000)]
I was in this module anyway, so I did some janitorial things.

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.

21 years agoAdd the get_completer() function based on Michael Stone's patch in
Michael W. Hudson [Thu, 30 Jan 2003 10:12:51 +0000 (10:12 +0000)]
Add the get_completer() function based on Michael Stone's patch in

[ 676342 ] after using pdb readline does not work correctly

which is required to fix that bug.  So maaybe a bugfix candidate.

21 years agoThere was a subtle big in save_newobj(): it used self.save_global(t)
Guido van Rossum [Thu, 30 Jan 2003 06:37:41 +0000 (06:37 +0000)]
There was a subtle big in save_newobj(): it used self.save_global(t)
on the type instead of self.save(t).  This defeated the purpose of
NEWOBJ, because it didn't generate a BINGET opcode when t was already
memoized; but moreover, it would generate multiple BINPUT opcodes for
the same type!  pickletools.dis() doesn't like this.

How I found this?  I was playing with picklesize.py in the datetime
sandbox, and noticed that protocol 2 pickles for multiple objects were
in fact larger than protocol 1 pickles!  That was suspicious, so I
decided to disassemble one of the pickles.

This really needs a unit test, but I'm exhausted.  I'll be late for
work as it is. :-(

21 years agoSlight code rearrangement to avoid testing getstate twice.
Guido van Rossum [Thu, 30 Jan 2003 05:41:19 +0000 (05:41 +0000)]
Slight code rearrangement to avoid testing getstate twice.

21 years agoIn save_newobj(), if an object's __getnewargs__ and __getstate__ are
Guido van Rossum [Thu, 30 Jan 2003 05:39:04 +0000 (05:39 +0000)]
In save_newobj(), if an object's __getnewargs__ and __getstate__ are
the same function, don't save the state or write a BUILD opcode.  This
is so that a type (e.g. datetime :-) can support protocol 2 using
__getnewargs__ while also supporting protocol 0 and 1 using
__getstate__.  (Without this, the state would be pickled twice with
protocol 2, unless __getstate__ is defined to return None, which
breaks protocol 0 and 1.)

21 years agoAuthor markup: Andrew got to it first
Raymond Hettinger [Thu, 30 Jan 2003 01:03:38 +0000 (01:03 +0000)]
Author markup:  Andrew got to it first

21 years agoSF patch 672098: Three __contains__ implementations
Raymond Hettinger [Thu, 30 Jan 2003 00:56:33 +0000 (00:56 +0000)]
SF patch 672098: Three __contains__ implementations

Contributed by Jp Calderone.

21 years agoFix [ 583477 ] wrong dest size.
Mark Hammond [Wed, 29 Jan 2003 22:38:29 +0000 (22:38 +0000)]
Fix [ 583477 ] wrong dest size.

Note this code is not used by the core on Win32, but in a block used only
by Windows CE.

21 years agoUse %c rather than chr() to turn some ints into chars.
Guido van Rossum [Wed, 29 Jan 2003 20:14:23 +0000 (20:14 +0000)]
Use %c rather than chr() to turn some ints into chars.

21 years agodis(): This had a problem with proto 0 pickles, in that POP sometimes
Tim Peters [Wed, 29 Jan 2003 20:12:21 +0000 (20:12 +0000)]
dis():  This had a problem with proto 0 pickles, in that POP sometimes
popped a MARK, but without stack emulation the disassembler couldn't
know that, and subsequent indentation got hosed.

Now the disassembler does do enough stack emulation to catch this.  While
I was at it, also added lots of sanity checks for other stack operations,
and correct use of the memo.  This goes (I think) a long way toward being
a "pickle verifier" now too.

21 years agoImplement appropriate __getnewargs__ for all immutable subclassable builtin
Guido van Rossum [Wed, 29 Jan 2003 17:58:45 +0000 (17:58 +0000)]
Implement appropriate __getnewargs__ for all immutable subclassable builtin
types.  The special handling for these can now be removed from save_newobj().
Add some testing for this.

Also add support for setting the 'fast' flag on the Python Pickler class,
which suppresses use of the memo.

21 years agoOnly log a message and chmod() when the mode isn't already what we
Guido van Rossum [Wed, 29 Jan 2003 16:58:31 +0000 (16:58 +0000)]
Only log a message and chmod() when the mode isn't already what we
want it to be.  Log both the old and new mode.

21 years ago- The mac-specific tests should also be run on darwin.
Jack Jansen [Wed, 29 Jan 2003 16:24:16 +0000 (16:24 +0000)]
- The mac-specific tests should also be run on darwin.
- Added test_aepack to the mac/darwin specific tests.

21 years agominor grammar tweaks
Skip Montanaro [Wed, 29 Jan 2003 15:41:33 +0000 (15:41 +0000)]
minor grammar tweaks

21 years agoTeach the parsermodule about floor division. Fixes
Michael W. Hudson [Wed, 29 Jan 2003 14:20:23 +0000 (14:20 +0000)]
Teach the parsermodule about floor division.  Fixes

[ 676521 ] parser module validation failure

bugfix candidate.

21 years agoMoved aepack test code to the test suite.
Jack Jansen [Wed, 29 Jan 2003 10:41:18 +0000 (10:41 +0000)]
Moved aepack test code to the test suite.

21 years agoSome objects could have uninitialized attributes. Fixed.
Jack Jansen [Wed, 29 Jan 2003 10:39:19 +0000 (10:39 +0000)]
Some objects could have uninitialized attributes. Fixed.

21 years agotest_macfs found an error on the first day of its existence: round trips for date...
Jack Jansen [Wed, 29 Jan 2003 09:56:56 +0000 (09:56 +0000)]
test_macfs found an error on the first day of its existence: round trips for date values to FSSpec.{Get,Set}Dates didn't work in MacPython-OS9. Fixed.

21 years agoDocument the demise of all pretenses of safety, and the difference
Guido van Rossum [Wed, 29 Jan 2003 06:24:30 +0000 (06:24 +0000)]
Document the demise of all pretenses of safety, and the difference
between cPickle and pickle.py regarding __safe_for_unpickling__ before
Python 2.3.

21 years agoDeclare Protocol 2 as implemented.
Guido van Rossum [Wed, 29 Jan 2003 06:16:12 +0000 (06:16 +0000)]
Declare Protocol 2 as implemented.

21 years agoSupport for extension codes. (By accident I checked in the tests first.)
Guido van Rossum [Wed, 29 Jan 2003 06:14:11 +0000 (06:14 +0000)]
Support for extension codes.  (By accident I checked in the tests first.)

21 years agoTest all three EXT opcodes, and move these tests into
Guido van Rossum [Wed, 29 Jan 2003 06:12:46 +0000 (06:12 +0000)]
Test all three EXT opcodes, and move these tests into
TempAbstractPickleTests, because they don't work with cPickle yet.

21 years agoMake the footer at the end of a \verbatiminput stand out a little
Fred Drake [Wed, 29 Jan 2003 05:14:44 +0000 (05:14 +0000)]
Make the footer at the end of a \verbatiminput stand out a little
more, to make it easier to tell apart from the verbatim content.

21 years agoMove a footnote to the end of the sentence, so the note mark won't
Fred Drake [Wed, 29 Jan 2003 05:10:27 +0000 (05:10 +0000)]
Move a footnote to the end of the sentence, so the note mark won't
interfere with the flow of the sentence.

21 years agoWhitespace normalization.
Tim Peters [Wed, 29 Jan 2003 03:49:43 +0000 (03:49 +0000)]
Whitespace normalization.

21 years agopickle: Comment repair.
Tim Peters [Wed, 29 Jan 2003 00:56:17 +0000 (00:56 +0000)]
pickle:  Comment repair.
pickletools:  Import decode_long from pickle instead of duplicating it.

21 years agoUpdated info about test_bsddb3 failures.
Tim Peters [Wed, 29 Jan 2003 00:38:42 +0000 (00:38 +0000)]
Updated info about test_bsddb3 failures.

21 years agoExpect test_macostools and test_macfs to get skipped whenever
Tim Peters [Wed, 29 Jan 2003 00:35:32 +0000 (00:35 +0000)]
Expect test_macostools and test_macfs to get skipped whenever
sys.platform != mac.  Likewise expect test_win{reg,sound} to get skipped
on non-win32 platforms.

21 years agoTest aliases too.
Jack Jansen [Tue, 28 Jan 2003 23:54:05 +0000 (23:54 +0000)]
Test aliases too.

21 years agoConverted to not use macfs whenever possible.
Jack Jansen [Tue, 28 Jan 2003 23:53:40 +0000 (23:53 +0000)]
Converted to not use macfs whenever possible.

21 years agoAdded a missing INCREF in pathname().
Jack Jansen [Tue, 28 Jan 2003 23:29:46 +0000 (23:29 +0000)]
Added a missing INCREF in pathname().

21 years agoTemporary hacks to arrange that the pickle tests relying on protocol 2
Tim Peters [Tue, 28 Jan 2003 22:34:11 +0000 (22:34 +0000)]
Temporary hacks to arrange that the pickle tests relying on protocol 2
only get run by test_pickle.py now (& not by test_cpickle.py).  This
should be undone when protocol 2 is implemented in cPickle too.
test_cpickle should pass again.

21 years agoAdd a comment about how some built-in types should grow a
Guido van Rossum [Tue, 28 Jan 2003 22:31:25 +0000 (22:31 +0000)]
Add a comment about how some built-in types should grow a
__getnewargs__ method.

21 years agoGet rid of __safe_for_unpickling__ and safe_constructors.
Guido van Rossum [Tue, 28 Jan 2003 22:29:13 +0000 (22:29 +0000)]
Get rid of __safe_for_unpickling__ and safe_constructors.

Also tidied up a few lines, got rid of apply(), added a comment.

21 years agoRenamed "bin" arguments to "proto". Note that this test currently
Tim Peters [Tue, 28 Jan 2003 22:26:28 +0000 (22:26 +0000)]
Renamed "bin" arguments to "proto".  Note that this test currently
fails, for reasons unrelated to this patch.

21 years agoMore markup changes for consistency.
Fred Drake [Tue, 28 Jan 2003 22:09:16 +0000 (22:09 +0000)]
More markup changes for consistency.

21 years agoVarious minor markup adjustments.
Fred Drake [Tue, 28 Jan 2003 22:02:35 +0000 (22:02 +0000)]
Various minor markup adjustments.

21 years agoAdd a test for a list subclass with a __dict__ as well as slots.
Guido van Rossum [Tue, 28 Jan 2003 22:02:31 +0000 (22:02 +0000)]
Add a test for a list subclass with a __dict__ as well as slots.

21 years agoInstead of bad hacks trying to worm around the inherited
Guido van Rossum [Tue, 28 Jan 2003 22:01:16 +0000 (22:01 +0000)]
Instead of bad hacks trying to worm around the inherited
object.__reduce__, do a getattr() on the class so we can explicitly
test for it.  The reduce()-calling code becomes a bit more regular as
a result.

Also add support slots: if an object has slots, the default state is
(dict, slots) where dict is the __dict__ or None, and slots is a dict
mapping slot names to slot values.  We do a best-effort approach to
find slot names, assuming the __slots__ fields of classes aren't
modified after class definition time to misrepresent the actual list
of slots defined by a class.

21 years agoAdded missing dependency.
Fred Drake [Tue, 28 Jan 2003 21:53:05 +0000 (21:53 +0000)]
Added missing dependency.

21 years agoInstall "python$(VERSION)" into /usr/local as the symlink to the framework,
Jack Jansen [Tue, 28 Jan 2003 21:45:44 +0000 (21:45 +0000)]
Install "python$(VERSION)" into /usr/local as the symlink to the framework,
and also create a symlink "python" pointing to "python$(VERSION)".
Fixes #675745.