seem collectively sufficient to justify assigning this version a new major release number.
Here’s a summary of what’s new this time around:
Python 3.X port
The code was updated to run under Python 3.X only; Python 2.X is no longer
supported without code changes. Although some of the task of porting to Python
3.X requires only minor coding changes, other idiomatic implications are more far
reaching. Python 3.X’s new Unicode focus, for example, motivated much of the
Internationalization support in this version of PyMailGUI (discussed ahead).
Layout improvements
View window forms are laid out with gridding instead of packed column frames,
for better appearance and platform neutrality of email headers (see Chapter 9 for
more details on form layout). In addition, list window toolbars are now arranged
with expanding separators for clarity; this effectively groups buttons by their roles
and scope. List windows are also larger when initially opened to show more.
Text editor fix for Tk change
Both the embedded text editor and some text editor instances popped up on de-
mand are now forcibly updated before new text is inserted, for accurate initial
positioning at line 1. See PyEdit in Chapter 11 for more on this requirement; it
stems from a recent change (bug?) in either Tk or tkinter.
Text editor upgrades inherited
Because the PyEdit program is reused in multiple roles here, this version of Py-
MailGUI also acquires all its latest fixes by proxy. Most prominently, these include
a new Grep external files search dialog and support for displaying, opening, and
saving Unicode text. See Chapter 11 for details.
Workaround for Python 3.1 bug on traceback prints
In the obscure-but-all-too-typical category: the common function in
SharedNames.py that prints traceback details had to be changed to work correctly
under Python 3.X. The traceback module’s print_tb function can no longer print
a stack trace to sys.stdout if the calling program is spawned from another on
Windows; it still can as before if the caller was run normally from a shell prompt.
Since this function is called from the main thread on worker thread exceptions, if
allowed to fail any printed error kills the GUI entirely when it is spawned from the
gadget or demo launchers.
To work around this, the function now catches exceptions when print_tb is called
and in response runs it again with a real file instead of sys.stdout. This appears to
be a Python 3.X regression, as the same code worked correctly in both contexts in
Python 2.5 and 2.6. Unlike some similar issues, it has nothing to do with printing
Unicode, as stack traces are all ASCII text. Even more baffling, directly printing to
stdout in the same function works fine. Hey, if it were easy, they wouldn’t call it
“work.”
Major PyMailGUI Changes| 1013