kivy: Python 3.7 Filechooser crash

Versions

  • Python3.7
  • OS:Windows 10
  • Kivy:1.10.1
  • Kivy installation method:PIP

Description

After the file selector popup happens the program crashes. The same code has no issue on python 3.6.

Code and Logs

[INFO   ] [Logger      ] Record log in C:\Users\DWL\.kivy\logs\kivy_18-07-24_16.txt
[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL" graphics system
[INFO   ] [GL          ] GLEW initialization succeeded
[INFO   ] [GL          ] Backend used <glew>
[INFO   ] [GL          ] OpenGL version <b'4.6.0 NVIDIA 388.43'>
[INFO   ] [GL          ] OpenGL vendor <b'NVIDIA Corporation'>
[INFO   ] [GL          ] OpenGL renderer <b'GeForce GTX 980 Ti/PCIe/SSE2'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 6
[INFO   ] [GL          ] Shading version <b'4.60 NVIDIA'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [VideoGstplayer] Using Gstreamer 1.14.1.0
[INFO   ] [Video       ] Provider: gstplayer
[INFO   ] [Base        ] Start application main loop
[INFO   ] [GL          ] NPOT texture support is available


The code used was lifted directly from your guide for filechooser.
If I change to python 3.6 the same code works.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 28 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@ElliotGarbus: I am taking a different position:

FileChooser needs to work out whether a file is hidden. On Windows it calls win32file.GetFileAttributesExW() which appears to stumble on files that are in use. The stumble is now logged, rather than crashing, which is a step forward.

Python 3.3 introduced os.stat(), which allows access to the hidden flag on Windows. We don’t need to support earlier versions of Python. So my proposal:

  • FileChooser’s is_hidden should be refactored to use:

    • os.stat() and stat.FILE_ATTRIBUTE_HIDDEN for Windows
    • os.stat() and stat.UF_HIDDEN for macOS
    • file starts with a dot for Linux, other platforms (and also for macOS too?)
  • FileChooser’s platform-dependent imports can then be cleaned up.

I fixed it by adding hiddenimports=[‘win32timezone’] to my .spec file. hope it helps!