]> granicus.if.org Git - python/log
python
21 years ago[Bug #676292] BaseHTTPServer incorrectly parses protocol; fix by Andrew Dalke
Andrew M. Kuchling [Mon, 3 Feb 2003 19:11:18 +0000 (19:11 +0000)]
[Bug #676292] BaseHTTPServer incorrectly parses protocol; fix by Andrew Dalke
   * Treat major, minor numbers of HTTP version as separate integers
   * Fix errors if version string is "HTTP/1.2.3" or even simply "BLAH".
   * send_error() checks if 'self.command' is a
     HEAD.  However, if there's an error parsing the first line of the
     HTTP request the self.command wasn't set yet; force
     self.command to be initialized to None.

21 years ago_slotnames(): exclude __dict__ and __weakref__; these aren't real
Guido van Rossum [Mon, 3 Feb 2003 18:10:09 +0000 (18:10 +0000)]
_slotnames(): exclude __dict__ and __weakref__; these aren't real
slots even though they can be listed in __slots__.

21 years agoSupport keyword argument 'bin', with a pending deprecation warning.
Guido van Rossum [Mon, 3 Feb 2003 16:59:48 +0000 (16:59 +0000)]
Support keyword argument 'bin', with a pending deprecation warning.

21 years agoProper testing of proto 2 in part requires checking that the new opcodes
Tim Peters [Mon, 3 Feb 2003 16:20:13 +0000 (16:20 +0000)]
Proper testing of proto 2 in part requires checking that the new opcodes
are actually getting generated.  Add helpered method
ensure_opcode_in_pickle to do a correct job checking for that.  Changed
test_long1(), test_long4(), and test_short_tuples() to use it.

21 years agobraino
Skip Montanaro [Mon, 3 Feb 2003 15:48:10 +0000 (15:48 +0000)]
braino

21 years agoPDATA_PUSH and PDATA_APPEND. documented, and reformatted for better
Tim Peters [Mon, 3 Feb 2003 15:45:56 +0000 (15:45 +0000)]
PDATA_PUSH and PDATA_APPEND.  documented, and reformatted for better
readability.

load_bool():  Now that I know the intended difference between _PUSH and
_APPEND, used the right one.

Pdata_grow():  Squashed out a redundant overflow test.

21 years agoBug #678077: Suggest alternative to os.getlogin()
Andrew M. Kuchling [Mon, 3 Feb 2003 15:36:26 +0000 (15:36 +0000)]
Bug #678077: Suggest alternative to os.getlogin()

21 years agotry to avoid gross incompatibilities with older versions of Python
Skip Montanaro [Mon, 3 Feb 2003 15:29:34 +0000 (15:29 +0000)]
try to avoid gross incompatibilities with older versions of Python

21 years agotry to avoid gross incompatibilities with earlier versions of Python
Skip Montanaro [Mon, 3 Feb 2003 15:28:23 +0000 (15:28 +0000)]
try to avoid gross incompatibilities with earlier versions of Python

21 years ago_PyLong_Sign(): remove an assert that needed a variable ndigits that
Guido van Rossum [Mon, 3 Feb 2003 15:28:19 +0000 (15:28 +0000)]
_PyLong_Sign(): remove an assert that needed a variable ndigits that
wasn't used outside the assert (and hence caused a compiler warning
about an unused variable in NDEBUG mode).  The assert wasn't very
useful any more.

_PyLong_NumBits(): moved the calculation of ndigits after asserting
that v != NULL.

21 years agotest_float_overflow(): make shuge (added last week) a little less
Guido van Rossum [Mon, 3 Feb 2003 15:25:01 +0000 (15:25 +0000)]
test_float_overflow(): make shuge (added last week) a little less
huge.  On older Linux systems, the C library's strtod() apparently
gives up before seeing the end of the string when it sees so many
digits that it thinks the result must be Infinity.  (It is wrong, BTW
-- there could be an "e-10000" hiding behind 10,000 digits.)  The
shorter shuge still tests what it's testing, without relying on
strtod() doing a super job.

21 years agoBug #676273: Rewrite paragraph in module docstring
Andrew M. Kuchling [Mon, 3 Feb 2003 15:21:15 +0000 (15:21 +0000)]
Bug #676273: Rewrite paragraph in module docstring

21 years agotest_support.requires(): Instead of raising TestSkipped, raise a new
Fred Drake [Mon, 3 Feb 2003 15:19:30 +0000 (15:19 +0000)]
test_support.requires():  Instead of raising TestSkipped, raise a new
exception, ResourceDenied.  This is used to distinguish between tests that
are skipped for other reasons (platform support, missing data, etc.) from
those that are skipped because a "resource" has not been enabled.  This
prevents those tests from being reported as unexpected skips for the
platform; those should only be considered unexpected skips if the resource
were enabled.

21 years agoadd note about new db2pickle.py and pickle2db.py scripts
Skip Montanaro [Mon, 3 Feb 2003 15:17:25 +0000 (15:17 +0000)]
add note about new db2pickle.py and pickle2db.py scripts

21 years ago[Bug #679251] Use correct constant name
Andrew M. Kuchling [Mon, 3 Feb 2003 15:16:15 +0000 (15:16 +0000)]
[Bug #679251] Use correct constant name

21 years agonote db2pickle.py and pickle2db.py
Skip Montanaro [Mon, 3 Feb 2003 15:09:32 +0000 (15:09 +0000)]
note db2pickle.py and pickle2db.py

21 years agodump database files to pickle format
Skip Montanaro [Mon, 3 Feb 2003 15:09:03 +0000 (15:09 +0000)]
dump database files to pickle format

21 years agoconvert pickles generated by db2pickle.py back to database files
Skip Montanaro [Mon, 3 Feb 2003 15:08:42 +0000 (15:08 +0000)]
convert pickles generated by db2pickle.py back to database files

21 years agoAdd __all__ (suggested by Raymond Hettinger).
Greg Ward [Mon, 3 Feb 2003 14:46:57 +0000 (14:46 +0000)]
Add __all__ (suggested by Raymond Hettinger).

Rename 'whitespace' global to '_whitespace' -- it's not part of the
public interface.

21 years agoRemove test_b1 and test_b2 from the list of tests
Walter Dörwald [Mon, 3 Feb 2003 11:54:39 +0000 (11:54 +0000)]
Remove test_b1 and test_b2 from the list of tests
that are no real tests, because test_b1 and
test_b2 no longer exist. (Spotted by Raymond Hettinger)

21 years agopatch #664131, fix config command on OSX and Linux
Just van Rossum [Mon, 3 Feb 2003 11:43:54 +0000 (11:43 +0000)]
patch #664131, fix config command on OSX and Linux

21 years agoFix bug
Michael W. Hudson [Mon, 3 Feb 2003 11:04:27 +0000 (11:04 +0000)]
Fix bug

[ 676342 ] after using pdb readline does not work correctly

using Michael Stone's patch so the completer functionality of
cmd is only setup between preloop and postloop.

21 years agoadd missing "summary" from long options list
Skip Montanaro [Mon, 3 Feb 2003 06:34:22 +0000 (06:34 +0000)]
add missing "summary" from long options list

21 years ago* Add description of PyInt_FromString.
Skip Montanaro [Mon, 3 Feb 2003 05:13:24 +0000 (05:13 +0000)]
* Add description of PyInt_FromString.
* Correct description of PyFloat_FromString.  While ignored, the pend
  argument still has to be given.
* Typo in PyLong_FromString.

21 years agoversion 4.1.4 (4.1.3 just released)
Gregory P. Smith [Mon, 3 Feb 2003 04:28:26 +0000 (04:28 +0000)]
version 4.1.4 (4.1.3 just released)

21 years agofix for use on python 2.1
Gregory P. Smith [Mon, 3 Feb 2003 04:19:40 +0000 (04:19 +0000)]
fix for use on python 2.1

21 years agoAdd PyFloat_FromString. Left the char **pend argument out of the
Skip Montanaro [Mon, 3 Feb 2003 03:56:36 +0000 (03:56 +0000)]
Add PyFloat_FromString.  Left the char **pend argument out of the
description since while there, it is useless and ignored, according to Tim's
commen.  (PyInt_FromString is also not described, but PyLong_FromString is.
Is the former deprecated?)

21 years agocPickle now implements enough of protocol 2 to enable all
Guido van Rossum [Mon, 3 Feb 2003 01:32:33 +0000 (01:32 +0000)]
cPickle now implements enough of protocol 2 to enable all
cross-pickling tests.

21 years agoFix comment typo.
Walter Dörwald [Sun, 2 Feb 2003 23:39:45 +0000 (23:39 +0000)]
Fix comment typo.

21 years agoFix typos.
Walter Dörwald [Sun, 2 Feb 2003 23:37:05 +0000 (23:37 +0000)]
Fix typos.

21 years agoFix typos.
Walter Dörwald [Sun, 2 Feb 2003 23:08:27 +0000 (23:08 +0000)]
Fix typos.

21 years agoGetting rid of macfs usage and almost all FSSpecs. Untested on MacOS9.
Jack Jansen [Sun, 2 Feb 2003 23:03:50 +0000 (23:03 +0000)]
Getting rid of macfs usage and almost all FSSpecs. Untested on MacOS9.

21 years agoThe FSAliasFile routines also have an in/out parameter.
Jack Jansen [Sun, 2 Feb 2003 23:00:21 +0000 (23:00 +0000)]
The FSAliasFile routines also have an in/out parameter.

21 years agocPickle support for TUPLE[123]. Incidentally plugged several undetected
Tim Peters [Sun, 2 Feb 2003 20:29:39 +0000 (20:29 +0000)]
cPickle support for TUPLE[123].  Incidentally plugged several undetected
overflow holes in Pdata_grow().

21 years agojeez, now I know why I shouldn't even _want_ to learn sh.
Just van Rossum [Sun, 2 Feb 2003 18:56:37 +0000 (18:56 +0000)]
jeez, now I know why I shouldn't even _want_ to learn sh.

21 years agoMassive edits. If p is a pointer to a struct, and p->f is a pointer to
Tim Peters [Sun, 2 Feb 2003 18:29:33 +0000 (18:29 +0000)]
Massive edits.  If p is a pointer to a struct, and p->f is a pointer to
a function, then

    p->f(arg1, arg2, ...)

is semantically the same as

    (*p->f)(arg1, arg2, ...)

Changed all instances of the latter into the former.  Given how often
the code embeds this kind of expression in an if test, the unnecessary
parens and dereferening operator were a real drag on readability.

21 years agoMinor cleanup, mostly adding horizontal whitespace, and breaking apart
Tim Peters [Sun, 2 Feb 2003 18:08:34 +0000 (18:08 +0000)]
Minor cleanup, mostly adding horizontal whitespace, and breaking apart
embedded assignments, for readability.

21 years agoImplemented proto 2 NEWTRUE and NEWFALSE in cPickle.
Tim Peters [Sun, 2 Feb 2003 17:59:11 +0000 (17:59 +0000)]
Implemented proto 2 NEWTRUE and NEWFALSE in cPickle.

21 years agoGet ossaudiodev to compile on freebsd 4.7
Neal Norwitz [Sun, 2 Feb 2003 17:59:06 +0000 (17:59 +0000)]
Get ossaudiodev to compile on freebsd 4.7

21 years agolong_from_binary_base(): Sped this a little by computing the # of bits
Tim Peters [Sun, 2 Feb 2003 17:33:53 +0000 (17:33 +0000)]
long_from_binary_base():  Sped this a little by computing the # of bits
needed outside the first loop.

21 years agoBeefed up the tests by putting in more "for proto in protocols:" outer
Tim Peters [Sun, 2 Feb 2003 17:26:40 +0000 (17:26 +0000)]
Beefed up the tests by putting in more "for proto in protocols:" outer
loops.  Renamed DATA and BINDATA to DATA0 and DATA1.  Included
disassemblies, but noted why we can't test them.  Added XXX comment to
cPickle about a mysterious comment, where pickle and cPickle diverge
in how they number PUT indices.

21 years agoAdd some notes that got python to work on the snake farm
Neal Norwitz [Sun, 2 Feb 2003 17:10:04 +0000 (17:10 +0000)]
Add some notes that got python to work on the snake farm

21 years agoFix compiler warning
Neal Norwitz [Sun, 2 Feb 2003 17:08:33 +0000 (17:08 +0000)]
Fix compiler warning

21 years agodump(): Added asserts that self->proto is sane.
Tim Peters [Sun, 2 Feb 2003 16:16:30 +0000 (16:16 +0000)]
dump():  Added asserts that self->proto is sane.

21 years agodump(): Fixed a stupid bug in new code. It wasn't possible for the bug
Tim Peters [Sun, 2 Feb 2003 16:14:23 +0000 (16:14 +0000)]
dump():  Fixed a stupid bug in new code.  It wasn't possible for the bug
to have an effect before protocol 3 is invented, so no test can be
written for this (yet).

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)