Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ce92b2

Browse files
committed
#10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5,
rather than the currently problematic Apple-supplied one, when running with the 64-/32-bit installer variant.
1 parent c598296 commit 4ce92b2

5 files changed

Lines changed: 77 additions & 26 deletions

File tree

Lib/idlelib/PyShell.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,13 @@ def main():
14171417
shell.interp.prepend_syspath(script)
14181418
shell.interp.execfile(script)
14191419

1420+
# Check for problematic OS X Tk versions and print a warning message
1421+
# in the IDLE shell window; this is less intrusive than always opening
1422+
# a separate window.
1423+
tkversionwarning = macosxSupport.tkVersionWarning(root)
1424+
if tkversionwarning:
1425+
shell.interp.runcommand(''.join(("print('", tkversionwarning, "')")))
1426+
14201427
root.mainloop()
14211428
root.destroy()
14221429

Lib/idlelib/macosxSupport.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ def isCarbonAquaTk(root):
3434
'AppKit' not in root.tk.call('winfo', 'server', '.'))
3535
return _carbonaquatk
3636

37+
def tkVersionWarning(root):
38+
"""
39+
Returns a string warning message if the Tk version in use appears to
40+
be one known to cause problems with IDLE. The Apple Cocoa-based Tk 8.5
41+
that was shipped with Mac OS X 10.6.
42+
"""
43+
44+
if (runningAsOSXApp() and
45+
('AppKit' in root.tk.call('winfo', 'server', '.')) and
46+
(root.tk.call('info', 'patchlevel') == '8.5.7') ):
47+
return (r"WARNING: The version of Tcl/Tk (8.5.7) in use may"
48+
r" be unstable.\n"
49+
r"Visit http://www.python.org/download/mac/tcltk/"
50+
r" for current information.")
51+
else:
52+
return False
53+
3754
def addOpenEventSupport(root, flist):
3855
"""
3956
This ensures that the application will respont to open AppleEvents, which
Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
This package will install Python $FULL_VERSION for Mac OS X
2-
$MACOSX_DEPLOYMENT_TARGET for the following
3-
architecture(s): $ARCHITECTURES.
2+
$MACOSX_DEPLOYMENT_TARGET for the following architecture(s):
3+
$ARCHITECTURES.
44

5-
Separate installers are available for older versions
6-
of Mac OS X, see the homepage, below.
5+
Installation requires approximately $INSTALL_SIZE MB of disk space,
6+
ignore the message that it will take zero bytes.
77

8-
Installation requires approximately $INSTALL_SIZE MB of disk
9-
space, ignore the message that it will take zero bytes.
8+
You must install onto your current boot disk, even though the
9+
installer does not enforce this, otherwise things will not work.
1010

11-
You must install onto your current boot disk, even
12-
though the installer does not enforce this, otherwise
13-
things will not work.
11+
Python consists of the Python programming language interpreter, plus
12+
a set of programs to allow easy access to it for Mac users including
13+
an integrated development environment, IDLE, plus a set of pre-built
14+
extension modules that open up specific Macintosh technologies to
15+
Python programs.
1416

15-
Python consists of the Python programming language
16-
interpreter, plus a set of programs to allow easy
17-
access to it for Mac users including an integrated development
18-
environment, IDLE, plus a set of pre-built extension modules
19-
that open up specific Macintosh technologies to Python programs.
17+
**** IMPORTANT ****
18+
19+
Before using IDLE or other programs using the tkinter graphical user
20+
interface toolkit, visit http://www.python.org/download/mac/tcltk/
21+
for current information about supported and recommended versions
22+
of Tcl/Tk for this version of Python and Mac OS X.
2023

21-
The installer puts the applications in "Python $VERSION"
22-
in your Applications folder, and the underlying machinery in
23-
$PYTHONFRAMEWORKINSTALLDIR. It can optionally place
24-
links to the command-line tools in /usr/local as well,
25-
by default you have to add the "bin" directory inside
26-
the framework to you shell's search path.
24+
*******************
25+
26+
The installer puts applications, an "Update Shell Profile" command,
27+
and an Extras folder containing demo programs and tools into the
28+
"Python $VERSION" subfolder of the system Applications folder,
29+
and puts the underlying machinery into the folder
30+
$PYTHONFRAMEWORKINSTALLDIR. It can
31+
optionally place links to the command-line tools in /usr/local/bin as
32+
well. Double-click on the "Update Shell Profile" command to add the
33+
"bin" directory inside the framework to your shell's search path.
2734

2835
More information on Python in general can be found at
2936
http://www.python.org.
Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
1+
{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
22
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
33
{\colortbl;\red255\green255\blue255;}
4-
\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0
4+
\paperw11904\paperh16836\margl1440\margr1440\vieww9640\viewh10620\viewkind0
55
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
66

77
\f0\fs24 \cf0 This package will install
8-
\b MacPython $FULL_VERSION
8+
\b Python $FULL_VERSION
99
\b0 for
1010
\b Mac OS X $MACOSX_DEPLOYMENT_TARGET
1111
\b0 .\
1212
\
13-
MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users including an integrated development environment \b IDLE\b0 plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\
13+
14+
\b Python for Mac OS X
15+
\b0 consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac OS X users including an integrated development environment
16+
\b IDLE
17+
\b0 and a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\
1418
\
15-
See the ReadMe file for more information.\
19+
See the ReadMe file and the Python documentation for more information.\
1620
\
1721

1822
\b NOTE:
19-
\b0 This package will by default not update your shell profile and will also not install files in /usr/local. Double-click \b Update Shell Profile\b0 at any time to make $FULL_VERSION the default Python.}
23+
\b0 This package will by default not update your shell profile and will also not install files in /usr/local. Double-click
24+
\b Update Shell Profile
25+
\b0 at any time to make $FULL_VERSION the default Python.\
26+
\
27+
28+
\b IMPORTANT:
29+
\b0
30+
\b IDLE
31+
\b0 and other programs using the
32+
\b tkinter
33+
\b0 graphical user interface toolkit require specific versions of the
34+
\b Tcl/Tk
35+
\b0 platform independent windowing toolkit. Visit {\field{\*\fldinst{HYPERLINK "http://www.python.org/download/mac/tcltk/"}}{\fldrslt http://www.python.org/download/mac/tcltk/}} for current information on supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.}

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ Core and Builtins
4343
Library
4444
-------
4545

46+
- Issue #10907: Warn OS X 10.6 IDLE users to use ActiveState Tcl/Tk 8.5,
47+
rather than the currently problematic Apple-supplied one, when running
48+
with the 64-/32-bit installer variant.
49+
4650
- Issue #4953: cgi.FieldStorage and cgi.parse() parse the request as bytes, not
4751
as unicode, and accept binary files. Add encoding and errors attributes to
4852
cgi.FieldStorage. Patch written by Pierre Quentel (with many inputs by Glenn

0 commit comments

Comments
 (0)