Jeremy Hylton [Fri, 27 Jun 2003 16:13:17 +0000 (16:13 +0000)]
Fix several bugs in handling of exceptions with trace function enabled.
If the callback raised an exception but did not set curexc_traceback,
the trace function was called with PyTrace_RETURN. That is, the trace
function was called with an exception set. The main loop detected the
exception when the trace function returned; it complained and disabled
tracing.
Fix the logic error so that PyTrace_RETURN only occurs if the callback
returned normally.
The trace function must be called for exceptions, too. So we had
to add new functionality to call with PyTrace_EXCEPTION. (Leads to a
rather ugly ifdef / else block that contains only a '}'.)
Reverse the logic and name of NOFIX_TRACE to FIX_TRACE.
SF bug #761337: datetime.strftime fails on trivial format string
The interning of short strings violates the refcnt==1 assumption for
_PyString_Resize().
A simple fix is to boost the initial value of "totalnew" by 1.
Combined with an NULL argument to PyString_FromStringAndSize(),
this assures that resulting format string is not interned.
This will remain true even if the implementation of
PyString_FromStringAndSize() changes because only the uninitialized
strings that can be interned are those of zero length.
Jeremy Hylton [Thu, 26 Jun 2003 23:20:20 +0000 (23:20 +0000)]
Don't call constructor() from pickle().
The constructor() call only made sense when it registered the
constructor as safe for unpickling. We should probably remove the
module-global function, but need to worry about backwards
compatibility.
Greg Stein [Tue, 24 Jun 2003 06:35:19 +0000 (06:35 +0000)]
Deal with a couple XXX comments which asked questions.
In response to "shouldn't the client close the file?", the answer is
"no". The original design behind HTTPConnection is that the client did
not have to worry about it. The response would close itself when you
read the last of the data from it. This closing also dealt with
allowing the connection to perform another request/response (if it was
a persistent connection).
However... the auto-close behavior broke compatibility with the
classic httplib.HTTP class' behavior when a zero-length response body
was present. In that situation, the HTTPResponse object was
auto-closing it since there was no data present, and for an HTTP/1.0
connection-close socket (or an HTTP/0.9 request) connection, that also
ended up closing the socket. When an httplib.HTTP user went to read
the socket... boom. A patch to correct the auto-close (for compat with
old httplib users) was added in rev 1.22.
But for non-zero-length *chunked* bodies, we should keep the
auto-close behavior. The library user is not reading the socket (they
can't cuz of the chunked response we just got done handling), so they
should be immune to the response closing the socket. In fact, I would
like to see (one day) the auto-close restored, and the HTTP subclass
would simply have a flag to disable that behavior (for back-compat
purposes).
Martin v. Löwis [Sun, 22 Jun 2003 07:52:56 +0000 (07:52 +0000)]
Idlefork patch #682347: convert Unicode strings from readline to
IOBinding.encoding. Also set sys.std{in,out,err}.encoding, for both
the local and the subprocess case.
Tim Peters [Sun, 22 Jun 2003 01:42:20 +0000 (01:42 +0000)]
2.3b2 on Windows will ship with Tcl/Tk 8.4.3. Note: this still didn't
fix the hangs on Win98SE when starting IDLE via "python" from a DOS box,
but did appear to make them harder to provoke. I closed that bug report
as being hopeless (and if someone wants to open it again, don't dare
assign it to me again <0.1 wink>).
Martin v. Löwis [Sat, 21 Jun 2003 13:26:28 +0000 (13:26 +0000)]
Set -d in compileall, to get proper path in case DESTDIR is not empty.
Also add force, to recompile string.pyc in DESTDIR (which would normally
compiled by running compileall.py).
Just van Rossum [Fri, 20 Jun 2003 21:43:36 +0000 (21:43 +0000)]
- do the right thing with symlinks inside directories we're copying
- move the normpath stuff around a bit
- added dubious special case to addPythonFramework()
Jack Jansen [Fri, 20 Jun 2003 21:40:57 +0000 (21:40 +0000)]
Cop out, and set things to be group-writeable recursively. The various
xxxMODE flags don't cut it. Also set the umask to 2 before doing the
compileall on the destination system.
Removed bytecode transformation for sequence packing/unpacking.
It depended on the previously removed basic block checker to
prevent a jump into the middle of the transformed block.
Clears SF 757818: tuple assignment -- SystemError: unknown opcode
Jack Jansen [Thu, 19 Jun 2003 22:35:20 +0000 (22:35 +0000)]
Added a target frameworkinstallextras (OSX framework build specific,
and not part of a normal frameworkinstall) that installs Demo and Tools
and a readme file into /Applications/MacPython-2.3/Extras. This will
give people access to the demos and tools if they instal Python through
the binary installer.
Tim Peters [Thu, 19 Jun 2003 03:23:06 +0000 (03:23 +0000)]
randrange(): 2.3 can no longer raises OverflowError on an int() call, so
some of this code because useless, and (worse) could return a long
instead of int (in Zope that's important, because a long can't be used
as a key in an IOBTree or IIBTree).
* Updated comment on design of imap()
* Added untraversed object in izip() structure
* Replaced the pairwise() example with a more general window() example
Greg Ward [Wed, 18 Jun 2003 00:53:06 +0000 (00:53 +0000)]
SF patch #755987 (Jim Ahlstrom):
This is a patch for Bug 755031: If a null byte appears in
a file name, Python zipfile.py retains it, but InfoZip
terminates the name. Null bytes in file names are used
as a trick by viruses. I tested WinZip, and it also
truncates the file name at the null byte.
The patch also fixes a buglet: If a zipfile incorrectly
uses a directory separator other than '/', there was an
invalid complaint that the central directory name does
not match the file header name.
I also removed my name from the top of the file. It was
there for legal reasons which I believe no longer apply.
Many people have worked on this file besides me.
Brett Cannon [Tue, 17 Jun 2003 21:52:34 +0000 (21:52 +0000)]
Change all header strings to be as if they were capitalize()'ed. Also call
capitalize in AbstractHTTPHandler before inserting headers into HTTP instance.
Ken Manheimer [Tue, 17 Jun 2003 19:18:57 +0000 (19:18 +0000)]
Remove short-circuitying grubbing by using last grubbed buffer. It's
evil - if the last grubbed buffer didn't happen to be the right one,
you couldn't remedy.
Mainline emacs compat - don't use third arg to buffer-substring (which
was for explicitly identifying the buffer in which to seek the
substring, and which turns out to be unnecessary).
Tim Peters [Tue, 17 Jun 2003 00:05:53 +0000 (00:05 +0000)]
SF bug 751956: graminit.[ch] don't build on windows
A change from Duncan Booth, to deal with changes in the way pgen gets
built. Note that graminit.[ch] aren't normally built on Windows (they're
obtained from CVS).