Barry Warsaw [Fri, 28 Feb 2003 15:27:40 +0000 (15:27 +0000)]
compile_atom(): Neal's last checkin removing the setting of i broke
the build, so I'm restoring it. I'm not sure what Neal's intent was,
since the line following the one he removed was "REQN(i, 1)" so i is
obviously used. ;)
Jack Jansen [Fri, 28 Feb 2003 12:51:18 +0000 (12:51 +0000)]
Moved the Apple workaround for the guard define for wchar_t out of
the #ifdef HAVE_NCURSES_H: the same problem exists on OSX 10.1 with
a fink-installed curses (which uses curses.h as the include file name).
Kurt B. Kaiser [Thu, 27 Feb 2003 23:04:17 +0000 (23:04 +0000)]
M rpc.py
M run.py
Move exception formatting out of rpc.py. This allows each end of the
link to format and print exceptions how and where it sees fit and makes it
easier for threads to display their own exceptions.
Jack Jansen [Thu, 27 Feb 2003 22:36:20 +0000 (22:36 +0000)]
Changing the window type to movable modal isn't enough to make the dialogs movable: apprently you also need to set a bit in the dlgx resource. Did this.
In the process of adding all the extended slice support I attempted to
change _PyEval_SliceIndex to round massively negative longs up to
-INT_MAX, instead of 0 but botched it. Get it right.
Module review:
* Changed variable name from 'list' to 'flist'.
* Replaced "while 1" with "while True".
* Replaced if/elif/elif/elif structure with a shorter and
faster dispatch dictionary that maps attrs to methods.
* Simplified and sped comparison logic by using
ifilter, ifilterfalse, and dict.fromkeys.
* Used True and False rather than 1 and 0.
Module review:
* Replaced "while 1" with "while True"
* Rewrote read() and readline() for clarity and speed.
* Replaced variable 'list' with 'hlist'
* Used augmented assignment in two places.
Fred Drake [Wed, 26 Feb 2003 19:51:23 +0000 (19:51 +0000)]
The macfs, macostools, and plistlib should not be expected to run
beyond Mac OS and Darwin. I'm not even sure they should be run on
Darwin, but I'll let someone more knowledgable on that tell us.
[Bug #668662] Patch from Pearu Pearson: if a C source file is
specified with an absolute path, the object file is also
written to an absolute path. The patch drops the drive and
leading '/' from the source path, so a path like /path/to/foo.c
results in an object file like build/temp.i686linux/path/to/foo.o.
Walter Dörwald [Wed, 26 Feb 2003 14:49:41 +0000 (14:49 +0000)]
Port test_ucn and test_unicodedata to PyUnit. Add a few tests for error
cases increasing coverage in unicodedata.c from 87% to 95%
(when the normalization tests are run). From SF patch #662807.
Jack Jansen [Tue, 25 Feb 2003 23:02:03 +0000 (23:02 +0000)]
If a resource file cannot be decoded because the directory is readonly
create a temporary file. This fixes #688011.
Got rid of the install() method in macresource, and replaced it with
a resource_filename() method which will optionally decode a given resourcefile
(which may be applesingle-encoded) and return the real resourcefile.
Use this new method in buildtools to copy the correct resource file to
the bundle. This fixes #688007.
Just van Rossum [Tue, 25 Feb 2003 20:25:12 +0000 (20:25 +0000)]
Addendum to #683658:
import warnings.py _after_ site.py has run. This ensures that site.py
is again the first .py to be imported, giving it back full control over
sys.path.
Just van Rossum [Tue, 25 Feb 2003 20:15:40 +0000 (20:15 +0000)]
Resolving parts of #688907:
- Replaced bootstrap shell script with Python script. This means
standalone apps built with bundlebuilder will not work on MacOS < 10.1,
since we depend (again) on an installed Python.
- Add a hack to set sys.executable; the bootstrap script does os.execve()
with an argv[0] that's different from the actual Python executable
(it has to match the CFBundleExecutable entry in the Info.plist to make
the app work both from the Finder and the command line, and it has to be
the bootstrap script), yet a proper sys.executable is needed to spawn
auxiliary processes.
Jack Jansen [Tue, 25 Feb 2003 13:34:22 +0000 (13:34 +0000)]
Workaround for bug #644243 (which is actually an Apple bug, I think): URLs
of the form file:/path/to/file don't work whereas file:///path/to/file
works fine. We convert the former to the latter.
Jack Jansen [Tue, 25 Feb 2003 13:14:43 +0000 (13:14 +0000)]
Refer to the Mac OS X bundle_loader by the altbininstall name, so that
building distutils extension modules also works if you've only done
an altinstall. Fixes bug #677293.
Jack Jansen [Tue, 25 Feb 2003 12:41:10 +0000 (12:41 +0000)]
In Mac OS X framework builds don't assume that the executable will be
called python.exe but actually pass it from the main Makefile to
Mac/OSX/Makefile. This makes framework builds work again on case
sensitive filesystems. Fixes bug #677753.
Walter Dörwald [Mon, 24 Feb 2003 20:17:32 +0000 (20:17 +0000)]
Change the test encoding from "ISO8859-1" to "ISO-8859-1"
(see SF bug #690309) and raise ImportErrors instead of
RuntimeErrors, so building Python continues even
if importing iconv_codecs fails.
This is a temporary fix until we get proper configure
support for "broken" iconv implementations.
Jack Jansen [Mon, 24 Feb 2003 12:56:36 +0000 (12:56 +0000)]
That fix was bogus, undone. The problem is that the iconv include file
is found if you are running fink, but the module doesn't work. For now
I disabled building iconv_codec on darwin.
Guido van Rossum [Mon, 24 Feb 2003 01:18:35 +0000 (01:18 +0000)]
Fix from SF patch #633359 by Greg Chapman for SF bug #610299:
The problem is in sre_compile.py: the call to
_compile_charset near the end of _compile_info forgets to
pass in the flags, so that the info charset is not compiled
with re.U. (The info charset is used when searching to find
the first character at which a match could start; it is not
generated for patterns beginning with a repeat like '\w{1}'.)
Neal Norwitz [Sun, 23 Feb 2003 23:28:15 +0000 (23:28 +0000)]
Fix SF bug #691793, Python 2.3a2 build fails on Tru64
Need to make sure that preprocessor directives start in first column.
This means we can't indent code which has preprocessor directives,
nor have a space between [ #include for example.
Jack Jansen [Sun, 23 Feb 2003 23:23:47 +0000 (23:23 +0000)]
Added a linkmodel attribute, showing how Python was built. This is so
packages can check that extension modules are built for the right type
of python. Current values can be static, framework, shared and cfm (for
completeness, for MacPyton-OS9).
Closes bug #691889. The reporter suggests backporting this to 2.2.3
and I think I agree.
Jack Jansen [Sun, 23 Feb 2003 22:59:01 +0000 (22:59 +0000)]
Disabled -prebind again when linking the interpreter on MacOSX. It caused
a serious slowdown when loading dynamic modules that depend on large shared
libraries or frameworks.
Guido van Rossum [Fri, 21 Feb 2003 22:02:54 +0000 (22:02 +0000)]
Implementing the salient parts of __reduce_ex__ in C.
This still falls back to helpers in copy_reg for:
- pickle protocols < 2
- calculating the list of slot names (done only once per class)
- the __newobj__ function (which is used as a token but never called)
Tim Peters [Fri, 21 Feb 2003 20:14:35 +0000 (20:14 +0000)]
SF bug 690622: test_cpickle overflows stack on MacOS9.
test_nonrecursive_deep(): Reduced nesting depth to 60.
Not a bugfix candidate. 2.3 increased the number of stack frames
needed to pickle a list (in order to get implement the "list
batching" unpickling memory optimization new in 2.3).
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