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.

classification
Title: askopenfilename crashes on XP with "Show pop-up description for folder and desktop items" on
Type: crash Stage: resolved
Components: Tkinter, Windows Versions: Python 3.4
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: alexwieder, martin.panter, paul.moore, serhiy.storchaka, steve.dower, terry.reedy, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-10-03 23:28 by alexwieder, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pickfile.py alexwieder, 2015-10-03 23:28 program that reproduces the error.
pickfile.tcl serhiy.storchaka, 2015-10-04 18:31
Messages (6)
msg252248 - (view) Author: alex wieder (alexwieder) * Date: 2015-10-03 23:28
Hi,

This is my first bug report, so please be gentle if I don't stick to protocol correctly. I'm also tired from spending about 8 hours tracking down this problem.

OS Affected: XP SP3 (maybe others as well, and I'm aware that python doesn't support xp anymore, but I have plenty of clients still on it). I suggest that you test this in more recent Windows versions as well.

To reproduce:
- Enable "Show Pop-up description for folder and desktop items" in Explorer->Tools->Folder Options->View.
- Create a small python script that opens the askopenfilename dialog.
- Open any local folder.
- Hover the mouse over some files and wait for the pointer to turn into an hourglass as the system tries to gather information for the pop-up for that file. (pdf's are ideal for this as it takes a few seconds for the pop-up to appear.)
- Once the pointer's an hourglass, double click on the file.

Workaround:
- Disable  "Show Pop-up description for folder and desktop items" in Explorer->Tools->Folder Options->View and the problem goes away.
msg252260 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-04 06:27
Your report is good except for defining what you mean by crash and how you ran pickfile.py.  (I assume 3.4 with tk 8.6 from your version selection.).

(There is also the comment-per-line style.  I know that some nasty books and profs inflict this style on new programmers, but you will be better off to avoid it.  Discuss on python-list if you want.)

Win 7: Organize -> Folder and search options -> View tab - Show ... selection.  I already had this selected, and have never had problem that I know of, using askopenfile daily from Idle.

On Win 7, 3.4, tk 8.6, from command line or IDLE, I cannot reproduce the problem.  The popup pop up within a second and there is no hourglass.

The last maintenance release of 3.4 will be this month, so unless a problem is visible with post XP and 3.5, this should be closed when 3.4.4 is out.
msg252273 - (view) Author: alex wieder (alexwieder) * Date: 2015-10-04 16:46
Terry, thanks for your feedback.

By crash, I mean python crashing with a Windows c0000005 error. I can't even capture that exception in a try...except structure.

This is on an Intel Core2Duo 2.7GHz with 4 GB of RAM, with Acrobat Reader X installed, which might account for Windows Explorer's delay in gathering the pdfs' information and presenting it in the pop-up. It also happens on a virtual XP machine I use at my office (VirtualBox running on an i7-based linux box).

I ran pickfile.py every way I could think of: with python's console interpreter, with the windows-based interpreter (no black console window showing up). In both cases I tried compiled and interpreted versions of it (.py & .pyc), and also from within Eclipse (regular run and debugger).

As long as a user double-clicks on a file while Windows is still gathering information to display in the pop-up, it crashes.

I will have access to win7 i5-based computers next week, so I can test  then, but these will be much faster computers, so this issue might be moot.

Python 3.4.3. I don't know how to check tkinter version, but it's the one that comes with the 3.4.3 python installer.

Comment-per-line... I know, but I need to be able to read my own code six months from now (I still maintain code written by me 25 years ago and if it weren't for those, I'd be screwed sometimes). I realize that this particular program is quite obvious, but pickfile.py is just a slice of a much longer file. I'll remove obvious comments if I have to post again.
msg252280 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-10-04 18:31
Please test Tcl version of your example.

    wish pickfile.tcl
msg252281 - (view) Author: alex wieder (alexwieder) * Date: 2015-10-04 18:41
wish pickfile.tcl? Sorry. Too cryptic for me.

I ran the following code from the python interpreter:

import tkinter as tk

tk.TclVersion 
tk.TkVersion

Both return 8.6.
msg252289 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-10-04 21:29
The Windows error, as opposed to Python traceback, is a crash. My machine is probably too fast even if it did have XP.

Serhiy: 'wish' is not a normal Windows command.

https://social.msdn.microsoft.com/Forums/en-US/2a65c068-4bf7-42ff-94b1-283105d5548d/fatal-errorexception-error-c0000005?forum=visualfoxprogeneral

says C0000005 is an
"Exception Error that occurs when a process (application, driver, etc.) tries to execute a processor command that references memory outside the space allocated to that process by the Operating System. 

There are many possible causes ranging from corrupt data tables, to a bad network connection, ActiveX controls, or  Printer or Video driver errors. WIthout knowing what type of error you are seeing, it is impossible to guess what the cause may be."

It can result either from corrupt system files on a particular machine or a bug in a particular application or a particular use of an application. Searching 'Windows c0000005 error tcl tk' lead to a stackoverflow answer reporting that running Tk.mainloop in a non-main thread without a command queue could lead to this error.

tkinter.filedialog.askopenfilename ends up running tcl command "tk_getSaveFile".  See tkinter.commondialog.  Searching "Windows c0000005 tk_getOpenFile" leads to

http://comp.lang.tcl.narkive.com/miTBmbe1/crash-in-tk-getopenfile
which ends on 2014-11-14 with "fixed in the trunk*. Even in the released 8.6.3 you should see the problem only if you are on a Windows version prior to Vista AND pass the same string to -typevariable and -filetypes." *8.6.4, delivered with 3.5.

So until there is a problem with tk 8.6.4+ on Vista+ on more than one machine, I am going to assume that you either have a bad file on your machine or that you ran into this known now-fixed tk bug.  Hence closing.
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69496
2015-10-04 21:29:50terry.reedysetstatus: open -> closed
type: behavior -> crash
messages: + msg252289

resolution: third party
stage: test needed -> resolved
2015-10-04 18:41:40alexwiedersetmessages: + msg252281
2015-10-04 18:31:53serhiy.storchakasetfiles: + pickfile.tcl
nosy: + serhiy.storchaka
messages: + msg252280

2015-10-04 16:46:39alexwiedersetmessages: + msg252273
2015-10-04 06:27:46terry.reedysettype: crash -> behavior
messages: + msg252260
stage: test needed
2015-10-04 05:03:35serhiy.storchakasetnosy: + terry.reedy
2015-10-04 00:17:15martin.pantersetnosy: + martin.panter
2015-10-03 23:28:41alexwiedercreate