Windows 10 Explorer file open dialog: filenames disappearing in compiled executable

Viewed 359

We have a sizeable, legacy Python application written in Python 2.7 64 bit on Windows 10 64 bit - with GUI in wxPython, heavy numerical computations via NumPy, 2D plotting with MatPlotLib, 3D with VTK and so on, which we distribute as py2exe compiled binary after converting all our own Python files to pyd (Windows dlls) using Cython.

Since about a month ago, we started experiencing a super weird behavior of the file open dialog on Windows - i.e., a dialog that appears when the user asks to load a model/file from disk. The issue is, all the filenames are gone, we can only see the icons for folders/files, no text at all.

Please see picture below:

enter image description here

As you can see, the central list which usually contains icons and filenames now displays only icons. The only way to get the filenames back is to right-click in the main window and select "Refresh" - although sometimes navigating to a different folder makes the filenames show up.

This behavior does not show up while using the Python code, only in the compiled app. And it does not happen with other software (Microsoft Office, Notepad++, anything else, they all use the native Windows file dialog like our app and they all work all right).

I have been fighting with this for days and days, and it's not that obvious what is going on as the executable distribution folder has hundreds of dlls and standard Python modules and sub-folders containing the Python standard library plus all 3rd party libraries... the possible interactions between those dlls and Windows native ones are uncountable.

We also have zero control on Windows updates, when and where and how, and zero access privileges on our machines as they are locked down corporate beasts.

Now, for the questions:

  1. Has anybody ever seen this behavior before in an app? If yes, can you point us to a possible solution?
  2. If no one has seen this before, do you know if there is a way to force a refresh of an open file dialog, by whatever mean necessary - whether it is a MFC command, a Python one via win32gui, a system call, a C hack, anything?

Thank you in advance from a hair-pulling fellow programmer.

EDIT

After some more pain, I found out that py2exe had included a Windows DLL (PROPSYS.dll) from my machine, which was incompatible with all other machines (they have all sort of architectures). Excluding that DLL from the build system has fixed the problem.

Thanks go to @Simon Mourier for the invaluable suggestion to look at the DLL used by the process. Thank you!!! If you post your comment as an answer I’ll accept it as solution.

1 Answers

In Windows, when an application fails in a strange way, one idea is to check what are the .dll loaded in that application's process and try to spot anything that looks strange.

This is especially true when you use the Common Dialog (Open, Save As) provider by the Windows Shell since doing that potentially bring in a lot of 3rd parties .dll, loading them in the process.

One of the best tool to check that is Process Explorer from Sysinternals.

Here is a screenshot that shows external .dll opened in standard Notepad just because I used the File Open dialog box. We can see Intel's extensions, Adobe extensions, OneDrive, etc.

enter image description here

It was not the issue here, but still, it apparently helped spot the problem.

Related