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
- Refactor is_hidden so it doesn't fail Sort imports according to PEP8. Use built-in `os.stat` instead of win32file's `GetFileAttributesExW()` because it handles (in use) system files. ^ Fixes #5873 St... — committed to Julian-O/kivy by Julian-O 7 months ago
- Refactor is_hidden to address #5873 * Added failing test before implementing fix. * Added super-basic iconview test, because the code is never exercised. * Refactor is_hidden so it doesn't fail: Use... — committed to Julian-O/kivy by Julian-O 7 months ago
@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()
andstat.FILE_ATTRIBUTE_HIDDEN
for Windowsos.stat()
andstat.UF_HIDDEN
for macOSFileChooser’s platform-dependent imports can then be cleaned up.
I fixed it by adding hiddenimports=[‘win32timezone’] to my .spec file. hope it helps!