Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileChooser crashes (Win10 64bit) if any file in_use on the target path #5595

Closed
3col opened this issue Feb 2, 2018 · 7 comments
Closed
Labels
awaiting-reply Waiting for reply from issue opener, will be closed if no reply Component: Widgets kivy/uix, style.kv Platform: Windows Status: Needs-analysis Issue needs to be analyzed if it's real

Comments

@3col
Copy link

3col commented Feb 2, 2018

Versions

  • Python: 3.6.3.amd64
  • OS: Win10 64bit
  • Kivy: 1.10.0
  • Kivy installation method: pip install / PyCharm

Description

For example on Kivy Showcase in \data\screens\filechoosers.kv file the FileChooser: have to set the "show_hidden: True". Otherwise FileChooser widget crashes (tested on Windows 10 64-bit), if any file is in_use on the target path. E.g. Win10 "C:\" always contains in_use (system) files; also any other in_use ~tempfile or logfile will cause same error.

Logs

Error log from PyCharm:
----------------------------------------------------------------------------------------------------------------
[ERROR  ] unable to access to <\hiberfil.sys>
Traceback (most recent call last):
  File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 178, in is_hidden
    return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
pywintypes.error: (32, 'GetFileAttributesEx', 'The process cannot access the file because it is being 
used by another process.')
[ERROR  ] unable to access to <\pagefile.sys>
Traceback (most recent call last):
  File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 178, in is_hidden
    return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
pywintypes.error: (32, 'GetFileAttributesEx', 'The process cannot access the file because it is being 
used by another process.')
[ERROR  ] unable to access to <\swapfile.sys>
Traceback (most recent call last):
  File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 178, in is_hidden
    return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
pywintypes.error: (32, 'GetFileAttributesEx', 'The process cannot access the file because it is being 
used by another process.')
[ERROR  ] unable to access to <\hiberfil.sys>
Traceback (most recent call last):
  File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 178, in is_hidden
    return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
pywintypes.error: (32, 'GetFileAttributesEx', 'The process cannot access the file because it is being 
used by another process.')
[ERROR  ] unable to access to <\pagefile.sys>
Traceback (most recent call last):
  File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 178, in is_hidden
    return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
pywintypes.error: (32, 'GetFileAttributesEx', 'The process cannot access the file because it is being 
used by another process.')
[ERROR  ] unable to access to <\swapfile.sys>
Traceback (most recent call last):
  File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 178, in is_hidden
    return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
pywintypes.error: (32, 'GetFileAttributesEx', 'The process cannot access the file because it is being 
used by another process.')


Error log from EXE built by Pyinstaller 3.3.1 (also 3.4.dev0+ab8fd9753 tested):
----------------------------------------------------------------------------------------------------------------
C:\...\Showcase>dist\main.exe
[INFO   ] [Logger      ] Record log in C:\...\settings\.kivy\logs\kivy_18-02-02_7.txt
[INFO   ] [Kivy        ] v1.10.0
[INFO   ] [Python      ] v3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [OSC         ] using <thread> for socket
[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.5.0 - Build 22.20.16.4836'>
[INFO   ] [GL          ] OpenGL vendor <b'Intel'>
[INFO   ] [GL          ] OpenGL renderer <b'Intel(R) HD Graphics 520'>
[INFO   ] [GL          ] OpenGL parsed version: 4, 5
[INFO   ] [GL          ] Shading version <b'4.50 - Build 22.20.16.4836'>
[INFO   ] [GL          ] Texture max size <16384>
[INFO   ] [GL          ] Texture max units <32>
[INFO   ] [Shader      ] fragment shader: <b"WARNING: 0:4: '' :  #version directive missing">
[INFO   ] [Shader      ] vertex shader: <b"WARNING: 0:4: '' :  #version directive missing">
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [GL          ] NPOT texture support is available
[INFO   ] [Base        ] Start application main loop
[WARNING] [Accordion   ] not enough space for displaying all children
[WARNING] [Accordion   ] need 132px, got 84px
[WARNING] [Accordion   ] layout aborted.
[WARNING] [Accordion   ] not enough space for displaying all children
[WARNING] [Accordion   ] need 132px, got 84px
[WARNING] [Accordion   ] layout aborted.
[INFO   ] [Base        ] Leaving application in progress...
 Traceback (most recent call last):
   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
 ModuleNotFoundError: No module named 'win32timezone'

 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "<frozen importlib._bootstrap>", line 968, in _find_and_load
 SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set

 The above exception was the direct cause of the following exception:

 Traceback (most recent call last):
   File "C:\...\Showcase\main.py", line 240, in <module>
     ShowcaseApp().run()
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\app.py", line 828, in run
     runTouchApp()
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\base.py", line 504, in runTouchApp
     EventLoop.window.mainloop()
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\core\window\window_sdl2.py", line 663, in mainloop
     self._mainloop()
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\core\window\window_sdl2.py", line 405, in _mainloop
     EventLoop.idle()
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\base.py", line 339, in idle
     Clock.tick()
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\clock.py", line 581, in tick
     self._process_events()
   File "kivy\_clock.pyx", line 367, in kivy._clock.CyClockBase._process_events (kivy\_clock.c:7700)
   File "kivy\_clock.pyx", line 397, in kivy._clock.CyClockBase._process_events (kivy\_clock.c:7577)
   File "kivy\_clock.pyx", line 395, in kivy._clock.CyClockBase._process_events (kivy\_clock.c:7498)
   File "kivy\_clock.pyx", line 167, in kivy._clock.ClockEvent.tick (kivy\_clock.c:3490)
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 697, in _update_files
     if self._create_files_entries():
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 717, in _create_files_entries
     index, total, item = next(self._gitems_gen)
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 828, in _generate_file_entries
     for index, total, item in self._add_files(path):
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 860, in _add_files
     files = [x for x in files if not is_hidden(x)]
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 860, in <listcomp>
     files = [x for x in files if not is_hidden(x)]
   File "C:\...\python-3.6.3.amd64\Lib\site-packages\kivy\uix\filechooser.py", line 178, in is_hidden
     return GetFileAttributesExW(fn)[0] & FILE_ATTRIBUTE_HIDDEN
   File "<frozen importlib._bootstrap>", line 968, in _find_and_load
 SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
[1200] Failed to execute script main
@welcome
Copy link

welcome bot commented Feb 2, 2018

👋 Thanks for opening your first issue here! Be sure to follow the issue template!

@irbigturtle
Copy link

@3col can confirm, this is still an issue. Can I ask how you are finding those logs? My instance doesn't raise an exceptions...

@matham matham added the Status: Needs-analysis Issue needs to be analyzed if it's real label Aug 23, 2018
@JamesYangLim
Copy link

I am getting the same problem as well

@stevewells20
Copy link
Contributor

I am confirming as well, on a VirtualBox instance of Win10 64bit. Can you share how to find those logs, @3col? I can only seem to get the one-line generic error message, "Failed to execute script".

@ElliotGarbus
Copy link
Contributor

@Julian-O This issue can be marked closed.
See: #5873 (comment)

@Julian-O
Copy link
Contributor

@stevewells20 @JamesYangLim @irbigturtle @3col: Are you still experiencing this issue on Kivy 2.2.1 with the latest dependencies?

@Julian-O Julian-O added the awaiting-reply Waiting for reply from issue opener, will be closed if no reply label Nov 30, 2023
Copy link

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-reply Waiting for reply from issue opener, will be closed if no reply Component: Widgets kivy/uix, style.kv Platform: Windows Status: Needs-analysis Issue needs to be analyzed if it's real
Projects
None yet
Development

No branches or pull requests

8 participants