This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年01月16日 09:38 by eb303, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| dialog-bug.py | eb303, 2009年01月16日 09:38 | |||
| stringify.diff | gpolo, 2009年06月21日 21:41 | |||
| Messages (7) | |||
|---|---|---|---|
| msg79944 - (view) | Author: (eb303) | Date: 2009年01月16日 09:38 | |
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. |
|||
| msg86345 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2009年04月22日 23:29 | |
I've verified it, it is indeed a bug in tkMessageBox.py which is very likely to be noticed while using tk 8.5 or newer. |
|||
| msg89584 - (view) | Author: Guilherme Polo (gpolo) * (Python committer) | Date: 2009年06月21日 21:41 | |
I guess this will have to be accepted without any tests, unless someone can come up with a way to test tk_messageBox under Windows and Mac. |
|||
| msg97610 - (view) | Author: Kirk Vander Meulen (kvander11) | Date: 2010年01月11日 22:20 | |
I've also confirmed this one (by chance). I'm on ubuntu linux, and I am seeing the problem in both 2.6 and 3.1, both using Tk 8.5. I don't see the problem on my windows install (Vista, python 2.5, not sure of the Tk version right now). But I did find a hack around this by explicitly creating and destroying a top level window following the askdirectory() dialog. Try this snippet on linux/unix, the call to askyesno() returns False always.
import tkFileDialog,tkMessageBox,Tkinter
theDirectory=tkFileDialog.askdirectory()
addDirectory=tkMessageBox.askyesno('a dialog','Add a directory?')
print addDirectory
But the following works fine:
import tkFileDialog,tkMessageBox,Tkinter
toplevel=Tkinter.Tk()
theDirectory=tkFileDialog.askdirectory()
toplevel.destroy()
addDirectory=tkMessageBox.askyesno('a dialog','Add a directory?')
print addDirectory
|
|||
| msg101159 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2010年03月16日 10:14 | |
the patch works for me with tcl8.5 |
|||
| msg101160 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2010年03月16日 10:54 | |
fixed for 2.7, 3.1, 3.2, commit pending for 2.6 until after the 2.6.5 release |
|||
| msg101356 - (view) | Author: Matthias Klose (doko) * (Python committer) | Date: 2010年03月20日 02:20 | |
committed to the 2.6 branch as well |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:44 | admin | set | github: 49211 |
| 2010年03月20日 02:20:21 | doko | set | status: pending -> closed assignee: gpolo -> messages: + msg101356 |
| 2010年03月16日 10:54:40 | doko | set | status: open -> pending resolution: fixed messages: + msg101160 |
| 2010年03月16日 10:14:10 | doko | set | nosy:
+ doko messages: + msg101159 stage: test needed -> patch review |
| 2010年01月11日 22:20:25 | kvander11 | set | nosy:
+ kvander11 messages: + msg97610 |
| 2009年06月21日 21:41:38 | gpolo | set | files:
+ stringify.diff keywords: + patch messages: + msg89584 |
| 2009年04月22日 23:39:38 | gpolo | set | stage: test needed |
| 2009年04月22日 23:29:31 | gpolo | set | versions:
+ Python 3.0, Python 3.1, Python 2.7 nosy: + gpolo messages: + msg86345 assignee: gpolo |
| 2009年01月16日 09:38:24 | eb303 | create | |