Scenario to reproduce the problem:
- Run the attached script.
- Click the 'Ask confirm' button and answer 'Yes'; it should print
True, which is the expected answer.
- Click the 'Ask file' button, select any file and confirm.
- Click the 'Ask confirm' button and answer 'Yes'.
The script prints False, which is obviously wrong.
Problem reproduced on Linux Red Hat Fedora Core 4, Suse Enterprise
Linux 9, Solaris 8 for Sparc and Solaris 10 on Intel. The script works
as expected on Windows 2000, so it seems to be Unix-specific.
Possible cause: the result of the _show function in tkMessageBox is not
always a string, apparently depending on what happened before. Changing
the last line to:
return str(res)
seemed to correct the problem for me. |