diff options
author | Barry Warsaw <barry@python.org> | 2012-07-30 18:34:43 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2012-07-30 18:34:43 (GMT) |
commit | 38732ea8326409e14350de1442558d6b9cf3a443 (patch) | |
tree | 7bc4430d71353c2b1ca9256f795e7145efeed7bf | |
parent | dee609c09fb9a09d5e341e2f5975150016f85f00 (diff) | |
parent | 504ba313fc081966b721a4e697dffc13840b9e69 (diff) | |
download | cpython-38732ea8326409e14350de1442558d6b9cf3a443.zip cpython-38732ea8326409e14350de1442558d6b9cf3a443.tar.gz cpython-38732ea8326409e14350de1442558d6b9cf3a443.tar.bz2 |
merge
-rw-r--r-- | Lib/idlelib/NEWS.txt | 3 | ||||
-rw-r--r-- | Lib/idlelib/macosxSupport.py | 16 | ||||
-rw-r--r-- | Lib/test/test_memoryio.py | 11 | ||||
-rw-r--r-- | Lib/tkinter/simpledialog.py | 2 | ||||
-rwxr-xr-x | Mac/BuildScript/build-installer.py | 57 | ||||
-rw-r--r-- | Misc/ACKS | 1 | ||||
-rw-r--r-- | Misc/NEWS | 13 | ||||
-rw-r--r-- | Modules/_io/bytesio.c | 12 | ||||
-rw-r--r-- | Python/traceback.c | 2 | ||||
-rw-r--r-- | setup.py | 4 |
10 files changed, 99 insertions, 22 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 1d87443..a0c957e 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -34,6 +34,9 @@ What's New in IDLE 3.3.0? - Issue #3573: IDLE hangs when passing invalid command line args (directory(ies) instead of file(s)). +- Issue #14018: Update checks for unstable system Tcl/Tk versions on OS X + to include versions shipped with OS X 10.7 and 10.8 in addition to 10.6. + What's New in IDLE 3.2.1? ========================= diff --git a/Lib/idlelib/macosxSupport.py b/Lib/idlelib/macosxSupport.py index f93ef11..9690442 100644 --- a/Lib/idlelib/macosxSupport.py +++ b/Lib/idlelib/macosxSupport.py @@ -37,17 +37,21 @@ def isCarbonAquaTk(root): def tkVersionWarning(root): """ Returns a string warning message if the Tk version in use appears to - be one known to cause problems with IDLE. The Apple Cocoa-based Tk 8.5 - that was shipped with Mac OS X 10.6. + be one known to cause problems with IDLE. + 1. Apple Cocoa-based Tk 8.5.7 shipped with Mac OS X 10.6 is unusable. + 2. Apple Cocoa-based Tk 8.5.9 in OS X 10.7 and 10.8 is better but + can still crash unexpectedly. """ if (runningAsOSXApp() and - ('AppKit' in root.tk.call('winfo', 'server', '.')) and - (root.tk.call('info', 'patchlevel') == '8.5.7') ): - return (r"WARNING: The version of Tcl/Tk (8.5.7) in use may" + ('AppKit' in root.tk.call('winfo', 'server', '.')) ): + patchlevel = root.tk.call('info', 'patchlevel') + if patchlevel not in ('8.5.7', '8.5.9'): + return False + return (r"WARNING: The version of Tcl/Tk ({0}) in use may" r" be unstable.\n" r"Visit http://www.python.org/download/mac/tcltk/" - r" for current information.") + r" for current information.".format(patchlevel)) else: return False diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py index 49ca44f..04ec8e7 100644 --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -654,6 +654,17 @@ class CBytesIOTest(PyBytesIOTest): memio.close() self.assertRaises(ValueError, memio.__setstate__, (b"closed", 0, None)) + check_sizeof = support.check_sizeof + + @support.cpython_only + def test_sizeof(self): + basesize = support.calcobjsize('P2nN2Pn') + check = self.check_sizeof + self.assertEqual(object.__sizeof__(io.BytesIO()), basesize) + check(io.BytesIO(), basesize ) + check(io.BytesIO(b'a'), basesize + 1 + 1 ) + check(io.BytesIO(b'a' * 1000), basesize + 1000 + 1 ) + class CStringIOTest(PyStringIOTest): ioclass = io.StringIO diff --git a/Lib/tkinter/simpledialog.py b/Lib/tkinter/simpledialog.py index 885804b..45302b4 100644 --- a/Lib/tkinter/simpledialog.py +++ b/Lib/tkinter/simpledialog.py @@ -282,7 +282,7 @@ class _QueryDialog(Dialog): self.entry = Entry(master, name="entry") self.entry.grid(row=1, padx=5, sticky=W+E) - if self.initialvalue: + if self.initialvalue is not None: self.entry.insert(0, self.initialvalue) self.entry.select_range(0, END) diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 69f9c82..688834e 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -161,6 +161,13 @@ USAGE = textwrap.dedent("""\ --universal-archs=x universal architectures (options: %(UNIVERSALOPTS)r, default: %(UNIVERSALARCHS)r) """)% globals() +# Dict of object file names with shared library names to check after building. +# This is to ensure that we ended up dynamically linking with the shared +# library paths and versions we expected. For example: +# EXPECTED_SHARED_LIBS['_tkinter.so'] = [ +# '/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl', +# '/Library/Frameworks/Tk.framework/Versions/8.5/Tk'] +EXPECTED_SHARED_LIBS = {} # Instructions for building libraries that are necessary for building a # batteries included python. @@ -460,27 +467,40 @@ def checkEnvironment(): # Because we only support dynamic load of only one major/minor version of # Tcl/Tk, ensure: # 1. there are no user-installed frameworks of Tcl/Tk with version - # higher than the Apple-supplied system version - # 2. there is a user-installed framework in /Library/Frameworks with the - # same version as the system version. This allows users to choose - # to install a newer patch level. + # higher than the Apple-supplied system version in + # SDKROOT/System/Library/Frameworks + # 2. there is a user-installed framework (usually ActiveTcl) in (or linked + # in) SDKROOT/Library/Frameworks with the same version as the system + # version. This allows users to choose to install a newer patch level. + frameworks = {} for framework in ['Tcl', 'Tk']: - #fw = dict(lower=framework.lower(), - # upper=framework.upper(), - # cap=framework.capitalize()) - #fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw - fwpth = 'Library/Frameworks/Tcl.framework/Versions/Current' + fwpth = 'Library/Frameworks/%s.framework/Versions/Current' % framework sysfw = os.path.join(SDKPATH, 'System', fwpth) - libfw = os.path.join('/', fwpth) + libfw = os.path.join(SDKPATH, fwpth) usrfw = os.path.join(os.getenv('HOME'), fwpth) - #version = "%(upper)s_VERSION" % fw + frameworks[framework] = os.readlink(sysfw) + if not os.path.exists(libfw): + fatal("Please install a link to a current %s %s as %s so " + "the user can override the system framework." + % (framework, frameworks[framework], libfw)) if os.readlink(libfw) != os.readlink(sysfw): fatal("Version of %s must match %s" % (libfw, sysfw) ) if os.path.exists(usrfw): fatal("Please rename %s to avoid possible dynamic load issues." % usrfw) + if frameworks['Tcl'] != frameworks['Tk']: + fatal("The Tcl and Tk frameworks are not the same version.") + + # add files to check after build + EXPECTED_SHARED_LIBS['_tkinter.so'] = [ + "/Library/Frameworks/Tcl.framework/Versions/%s/Tcl" + % frameworks['Tcl'], + "/Library/Frameworks/Tk.framework/Versions/%s/Tk" + % frameworks['Tk'], + ] + # Remove inherited environment variables which might influence build environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_', 'LD_', 'LIBRARY_', 'PATH', 'PYTHON'] @@ -861,12 +881,12 @@ def buildPython(): frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework') gid = grp.getgrnam('admin').gr_gid + shared_lib_error = False for dirpath, dirnames, filenames in os.walk(frmDir): for dn in dirnames: os.chmod(os.path.join(dirpath, dn), STAT_0o775) os.chown(os.path.join(dirpath, dn), -1, gid) - for fn in filenames: if os.path.islink(fn): continue @@ -877,6 +897,19 @@ def buildPython(): os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP) os.chown(p, -1, gid) + if fn in EXPECTED_SHARED_LIBS: + # check to see that this file was linked with the + # expected library path and version + data = captureCommand("otool -L %s" % shellQuote(p)) + for sl in EXPECTED_SHARED_LIBS[fn]: + if ("\t%s " % sl) not in data: + print("Expected shared lib %s was not linked with %s" + % (sl, p)) + shared_lib_error = True + + if shared_lib_error: + fatal("Unexpected shared library errors.") + if PYTHON_3: LDVERSION=None VERSION=None @@ -700,6 +700,7 @@ Piotr Meyer Alexis Métaireau Steven Miale Trent Mick +Tom Middleton Stan Mihai Stefan Mihaila Aristotelis Mikropoulos @@ -68,6 +68,9 @@ Core and Builtins Library ------- +- Issue #15463: the faulthandler module truncates strings to 500 characters, + instead of 100, to be able to display long file paths + - Issue #6056: Make multiprocessing use setblocking(True) on the sockets it uses. Original patch by J Derek Wilson. @@ -267,8 +270,10 @@ Tests Build ----- +- Issue #14018: Fix OS X Tcl/Tk framework checking when using OS X SDKs. + - Issue #15431: Add _freeze_importlib project to regenerate importlib.h - on Windows. Patch by Kristján Valur Jónsson. + on Windows. Patch by Kristján Valur Jónsson. - Issue #14197: For OS X framework builds, ensure links to the shared library are created with the proper ABI suffix. @@ -337,6 +342,12 @@ Core and Builtins Library ------- +- Issue #12288: Consider '0' and '0.0' as valid initialvalue + for tkinter SimpleDialog. + +- Issue #15489: Add a __sizeof__ implementation for BytesIO objects. + Patch by Serhiy Storchaka. + - Issue #15487: Add a __sizeof__ implementation for buffered I/O objects. Patch by Serhiy Storchaka. diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index 65ec931..3d027e2 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -834,6 +834,17 @@ bytesio_init(bytesio *self, PyObject *args, PyObject *kwds) return 0; } +static PyObject * +bytesio_sizeof(bytesio *self, void *unused) +{ + Py_ssize_t res; + + res = sizeof(bytesio); + if (self->buf) + res += self->buf_size; + return PyLong_FromSsize_t(res); +} + static int bytesio_traverse(bytesio *self, visitproc visit, void *arg) { @@ -876,6 +887,7 @@ static struct PyMethodDef bytesio_methods[] = { {"truncate", (PyCFunction)bytesio_truncate, METH_VARARGS, truncate_doc}, {"__getstate__", (PyCFunction)bytesio_getstate, METH_NOARGS, NULL}, {"__setstate__", (PyCFunction)bytesio_setstate, METH_O, NULL}, + {"__sizeof__", (PyCFunction)bytesio_sizeof, METH_NOARGS, NULL}, {NULL, NULL} /* sentinel */ }; diff --git a/Python/traceback.c b/Python/traceback.c index ce670f3..b928902 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -14,7 +14,7 @@ #define OFF(x) offsetof(PyTracebackObject, x) #define PUTS(fd, str) write(fd, str, strlen(str)) -#define MAX_STRING_LENGTH 100 +#define MAX_STRING_LENGTH 500 #define MAX_FRAME_DEPTH 100 #define MAX_NTHREADS 100 @@ -69,7 +69,9 @@ def is_macosx_sdk_path(path): """ Returns True if 'path' can be located in an OSX SDK """ - return (path.startswith('/usr/') and not path.startswith('/usr/local')) or path.startswith('/System/') + return ( (path.startswith('/usr/') and not path.startswith('/usr/local')) + or path.startswith('/System/') + or path.startswith('/Library/') ) def find_file(filename, std_dirs, paths): """Searches for the directory where a given file is located, |