Walter Dörwald [Fri, 21 Feb 2003 18:18:49 +0000 (18:18 +0000)]
Use 'ISO8859-1' instead of 'ASCII' when testing whether byteswapping
is required for the chosen internal encoding in the init function,
as this seems to have a better chance of working under Irix and
Solaris.
Also change the test character from '\x01' to '0'.
Jack Jansen [Fri, 21 Feb 2003 16:31:11 +0000 (16:31 +0000)]
Added a method WMAvailable(). This will return True if and only if there
is a window manager and we can connect to it, i.e. if it is safe to try
and put up windows.
As a side effect the first call will make the current process frontmost.
Walter Dörwald [Fri, 21 Feb 2003 12:53:50 +0000 (12:53 +0000)]
Port all string tests to PyUnit and share as much tests
between str, unicode, UserString and the string module
as possible. This increases code coverage in stringobject.c
from 83% to 86% and should help keep the string classes
in sync in the future. From SF patch #662807
time.sleep(1) sometimes delays for fractionally less than a second
resulting in too short of an interval for C's time.time() function
to create a distinct seed.
Thomas Heller [Thu, 20 Feb 2003 20:32:11 +0000 (20:32 +0000)]
Strange control flow in PyInt_AsLong. When nb_int is called inside
the PyInt_AsLong function, and this returns a long, the value is first
retrieved with PyLong_AsLong, but afterwards overwritten by a call to
PyInt_AS_LONG.
As far as I can tell PyEval_GetOwner was removed in 1997 (when it was
called something else!). I can't imagine removing the prototype is
going to hurt, but put it back if *you* can.
Guido van Rossum [Wed, 19 Feb 2003 17:50:16 +0000 (17:50 +0000)]
The connect timeout code wasn't working on Windows.
Rather than trying to second-guess the various error returns
of a second connect(), use select() to determine whether the
socket becomes writable (which means connected).
Guido van Rossum [Wed, 19 Feb 2003 15:25:10 +0000 (15:25 +0000)]
- 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.)
Andrew MacIntyre [Wed, 19 Feb 2003 12:51:34 +0000 (12:51 +0000)]
OS/2 has no concept of file ownership, like DOS & MS Windows version
prior to NT. EMX has a number of Posix emulation routines, including
geteuid() but lacks chown(), so silently skip trying to actually set
a file ownership when extracting a file from a tar archive.
Jack Jansen [Wed, 19 Feb 2003 10:37:08 +0000 (10:37 +0000)]
Use pythonw as the default interpreter also for .py scripts (overridable
by the user), as this will cause the least surprises with scripts
brought over from other unixen. Suggested by Kevin Altis.
Guido van Rossum [Wed, 19 Feb 2003 03:19:29 +0000 (03:19 +0000)]
PyObject_Generic{Get,Set}Attr:
Don't access tp_descr_{get,set} of a descriptor without checking the
flag bits of the descriptor's type. While we know that the main type
(the type of the object whose attribute is being accessed) has all the
right flag bits (or else PyObject_Generic{Get,Set}Attr wouldn't be
called), we don't know that for its class attributes!
Tim Peters [Wed, 19 Feb 2003 02:44:12 +0000 (02:44 +0000)]
Reverted whitespace normalization on this file. I should really change
this thing so it doesn't rely on being unnormalized. (That's the
editorial "I", if anyone's listening <wink>.)
Jack Jansen [Tue, 18 Feb 2003 23:29:46 +0000 (23:29 +0000)]
Added an argv_emulation option (command line option: --argv or -a) which
creates the sys.argv emulation wrapper for droplets. Also updates
the plist, if needed, and the includedModules (but this last is untested).
Guido van Rossum [Tue, 18 Feb 2003 22:05:12 +0000 (22:05 +0000)]
Introducing __reduce_ex__, which is called with a protocol number argument
if it exists in preference over __reduce__. Now Tim can go implement this
in cPickle.c.
Tim Peters [Tue, 18 Feb 2003 20:50:45 +0000 (20:50 +0000)]
save_global(): Trying to resolve module.name can fail for two
reasons: importing module can fail, or the attribute lookup
module.name can fail. We were giving the same error msg for
both cases, making it needlessly hard to guess what went wrong.
These cases give different error msgs now.
Guido van Rossum [Tue, 18 Feb 2003 19:22:22 +0000 (19:22 +0000)]
The recent changes to super(), in particular supercheck(), broke when
using super() for an instance in a metaclass situation. Because the
class was a metaclass, the instance was a class, and hence the
PyType_Check() branch was taken. But this branch didn't apply. Make
it so that if this branch doesn't apply, the other branch is still
tried. All tests pass.
Jeremy Hylton [Tue, 18 Feb 2003 15:06:17 +0000 (15:06 +0000)]
Copy the trace module here from Tools/scripts.
There are some problems with this module, but the tool works for
simple tasks and no one else has volunteered a better code coverage
tool. Should cleanup and document before the beta release.
Neal Norwitz [Tue, 18 Feb 2003 03:37:49 +0000 (03:37 +0000)]
Fix 64-bit problem, ParseTuple("i") needs C ints; ("l") needs C longs.
Use "l" as that *probably* makes more sense (at least to me it does :-)
And the test passes on the alpha.
Kurt B. Kaiser [Mon, 17 Feb 2003 18:57:16 +0000 (18:57 +0000)]
M NEWS.txt
M PyShell.py
M ScriptBinding.py
M rpc.py
M run.py
Clean up the way IDLEfork handles termination of the subprocess, restore
ability to interrupt user code in Windows (so long as it's doing terminal
I/O).
1. Handle subprocess interrupts in Windows with an RPC message.
2. Run/F5 will restart the subprocess even if user code is running.
3. Restart the subprocess if the link is dropped.
4. Exit IDLE cleanly even during I/O.
4. In rpc.py, remove explicit calls to statelock, let the condition
variable handle acquire() and release().
Neal Norwitz [Mon, 17 Feb 2003 18:05:20 +0000 (18:05 +0000)]
Use correct function name to PyArg_ParseTuple("is_package").
Fix off-by-1 error in normalize_line_endings():
when *p == '\0' the NUL was copied into q and q was auto-incremented,
the loop was broken out of,
then a newline was appended followed by a NUL.
So the function, in effect, was strcpy() but added two extra chars
which was caught by obmalloc in debug mode, since there was only
room for 1 additional newline.
Get test working under regrtest (added test_main).
Jack Jansen [Mon, 17 Feb 2003 16:47:12 +0000 (16:47 +0000)]
When installing resource files whose name ends in .rsrc use the
"copy anything to a data fork based resource file" trick of macresource.
Fixes #688007.
Andrew MacIntyre [Mon, 17 Feb 2003 09:17:50 +0000 (09:17 +0000)]
Tweak to Skip's checkin of patch 686397:
- 'os2' references in ntpath.py relate to the VACPP port, not the EMX port;
- the VACPP port uses the same defpath as all other ntpath.py supported
platforms except 'ce'.