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
Python 3.7 Filechooser crash #5873
Comments
Finally, after some Google-ing, I found someone with same issue. For me, same crash happening on Windows Server 2012 OS. And, yes, same code is working fine with Python 3.6 |
I am unclear. Is this issue being looked at or are we supposed to use 3.6? |
Apparently nobody found the time/incentive to look into it yet, you can get a more detailed log by running python main.py -c kivy:log_level:trace and post it. I just tested on python3.7 on linux, and i don't get the issue, so it's probably platform-specific. |
Sorry, have been meaning to respond to this. The problem is very likely with There are two distributions that provide the required modules I think, https://pypi.org/project/pywin32/ and https://pypi.org/project/pypiwin32/. Please take a look with For reference, on py35 I have |
Here is a screenshot of what I have, both and both up to date.
On Wednesday, September 26, 2018, 5:40:16 PM PDT, matham <notifications@github.com> wrote:
Sorry, have been meaning to respond to this. The problem is very likely with win32file that is installed by pypiwin32. That is the only thing we import in filechooser selectively on windows that could be responsible https://github.com/kivy/kivy/blob/master/kivy/uix/filechooser.py#L120.
There are two distributions that provide the required modules I think, https://pypi.org/project/pywin32/ and https://pypi.org/project/pypiwin32/. Please take a look with pip freeze to see what you have installed. Try uninstalling and switching to the other to see if that fixes it and report back here with the results. You could also completely uninstalling both, but I'm not sure what else you have installed that may need it.
For reference, on py35 I have pypiwin32==219.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Here is the log info:
```
C:\Users\DWL\Documents\Python_Projects\Kivy\Test\BlackBook-GUI-Kivy>python bbgui.py -c kivy:log_level:trace[INFO ] [Logger ] Record log in C:\Users\DWL\.kivy\logs\kivy_18-09-26_2.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[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=None[TRACE ] [Lang ] load file C:\Program Files (x86)\Python37-32\lib\site-packages\kivy\data\style.kv[TRACE ] [Parser ] parsing 1291 lines[TRACE ] [Parser ] got directive <kivy 1.0>[TRACE ] [Builder ] build rule for <Label>[TRACE ] [Builder ] build rule for <-Button,-ToggleButton>[TRACE ] [Builder ] build rule for <BubbleContent>[TRACE ] [Builder ] build rule for <BubbleButton>[TRACE ] [Builder ] build rule for <Slider>[TRACE ] [Builder ] build rule for <ProgressBar>[TRACE ] [Builder ] build rule for <SplitterStrip>[TRACE ] [Builder ] build rule for <Scatter>[TRACE ] [Builder ] build rule for <RelativeLayout>[TRACE ] [Builder ] build rule for <Image,AsyncImage>[TRACE ] [Builder ] build rule for <EffectWidget>[TRACE ] [Builder ] build rule for <TabbedPanelContent>[TRACE ] [Builder ] build rule for <TabbedPanelStrip>[TRACE ] [Builder ] build rule for <StripLayout>[TRACE ] [Builder ] build rule for <TabbedPanelHeader>[TRACE ] [Builder ] build rule for <Selector>[TRACE ] [Builder ] build rule for <TextInput>[TRACE ] [Builder ] build rule for <TextInputCutCopyPaste>[TRACE ] [Builder ] build rule for <CodeInput>[TRACE ] [Builder ] build rule for <TreeViewNode>[TRACE ] [Builder ] build rule for <TreeViewLabel>[TRACE ] [Builder ] build rule for <StencilView>[TRACE ] [Builder ] build rule for <FileChooserListLayout>[TRACE ] [Builder ] build rule for <FileChooserListView>[TRACE ] [Builder ] build template for [FileListEntry@FloatLayout+TreeViewNode][TRACE ] [Builder ] build rule for <FileChooserIconLayout>[TRACE ] [Builder ] build rule for <FileChooserIconView>[TRACE ] [Builder ] build template for [FileIconEntry@Widget][TRACE ] [Builder ] build rule for <FileChooserProgress>[TRACE ] [Builder ] build rule for <Switch>[TRACE ] [Builder ] build rule for <ModalView>[TRACE ] [Builder ] build rule for <Popup>[TRACE ] [Builder ] build rule for <SpinnerOption>[TRACE ] [Builder ] build rule for <Spinner>[TRACE ] [Builder ] build rule for <ActionBar>[TRACE ] [Builder ] build rule for <ActionView>[TRACE ] [Builder ] build rule for <ActionSeparator>[TRACE ] [Builder ] build rule for <ActionButton,ActionToggleButton>[TRACE ] [Builder ] build rule for <ActionLabel>[TRACE ] [Builder ] build rule for <ActionGroup>[TRACE ] [Builder ] build rule for <ActionCheck>[TRACE ] [Builder ] build rule for <ActionPreviousImage@Image>[TRACE ] [Builder ] build rule for <ActionPreviousButton@Button>[TRACE ] [Builder ] build rule for <ActionPrevious>[TRACE ] [Builder ] build rule for <ActionGroup>[TRACE ] [Builder ] build rule for <ActionOverflow>[TRACE ] [Builder ] build rule for <ActionDropDown>[TRACE ] [Builder ] build template for [AccordionItemTitle@Label][TRACE ] [Builder ] build rule for <AccordionItem>[TRACE ] [Builder ] build rule for <SettingSpacer>[TRACE ] [Builder ] build rule for <SettingItem>[TRACE ] [Builder ] build rule for <SettingBoolean>[TRACE ] [Builder ] build rule for <SettingString>[TRACE ] [Builder ] build rule for <SettingPath>[TRACE ] [Builder ] build rule for <SettingOptions>[TRACE ] [Builder ] build rule for <SettingTitle>[TRACE ] [Builder ] build rule for <SettingSidebarLabel>[TRACE ] [Builder ] build rule for <SettingsPanel>[TRACE ] [Builder ] build rule for <Settings>[TRACE ] [Builder ] build rule for <InterfaceWithSidebar>[TRACE ] [Builder ] build rule for <InterfaceWithSpinner>[TRACE ] [Builder ] build rule for <MenuSpinner>[TRACE ] [Builder ] build rule for <MenuSidebar>[TRACE ] [Builder ] build rule for <ContentPanel>[TRACE ] [Builder ] build rule for <InterfaceWithTabbedPanel>[TRACE ] [Builder ] build rule for <ScrollView>[TRACE ] [Builder ] build rule for <VideoPlayerPreview>[TRACE ] [Builder ] build rule for <VideoPlayerAnnotation>[TRACE ] [Builder ] build rule for <VideoPlayer>[TRACE ] [Builder ] build rule for <CheckBox>[TRACE ] [Builder ] build rule for <ScreenManager>[TRACE ] [Builder ] build rule for <ColorPicker_Input@TextInput>[TRACE ] [Builder ] build rule for <ColorPicker_Label@Label>[TRACE ] [Builder ] build rule for <ColorPicker_Selector@BoxLayout>[TRACE ] [Builder ] build rule for <ColorWheel>[TRACE ] [Builder ] build rule for <ColorPicker>[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=None[TRACE ] [Image ] Unable to use <gif> as loader![TRACE ]Traceback (most recent call last): File "C:\Program Files (x86)\Python37-32\lib\site-packages\kivy\core\image\img_pil.py", line 8, in <module> import Image as PILImageModuleNotFoundError: No module named 'Image'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Program Files (x86)\Python37-32\lib\site-packages\kivy\core\__init__.py", line 129, in core_register_libs level=0) File "C:\Program Files (x86)\Python37-32\lib\site-packages\kivy\core\image\img_pil.py", line 11, in <module> from PIL import Image as PILImageModuleNotFoundError: No module named 'PIL'[TRACE ] [Image ] Unable to use <gif> as loader![TRACE ]Traceback (most recent call last): File "C:\Program Files (x86)\Python37-32\lib\site-packages\kivy\core\__init__.py", line 129, in core_register_libs level=0) File "C:\Program Files (x86)\Python37-32\lib\site-packages\kivy\core\image\img_ffpyplayer.py", line 7, in <module> import ffpyplayerModuleNotFoundError: No module named 'ffpyplayer'[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600[TRACE ] [Parser ] parsing 19 lines[TRACE ] [Builder ] build rule for <-CoverBehavior>[INFO ] [Window ] Provider: sdl2[INFO ] [GL ] Using the "OpenGL" graphics system[INFO ] [GL ] GLEW initialization succeeded[DEBUG ] [GL ] available extensions:
```
|
Did you forget to include a screenshot? You said The log doesn't help because these crashes don't get logged and it's a very long log so I'm snipping it. |
No I didn't forget the screenshot it is a png attached to the e-mail.. I'll attach again.
On Wednesday, September 26, 2018, 7:24:23 PM PDT, matham <notifications@github.com> wrote:
Did you forget to include a screenshot? The log doesn't help much because these crashes don't get logged.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Check the issue #5873 - the image is not shown. |
You seem to have both installed. Can you please experiment by uninstalling
one or both to see which causes the issue?
Kivy doesn't list this in its dependencies I think so I'm not sure who is
responsible for pulling it in. So at best we can just tell people to
uninstall the problem one.
…On Thu, Sep 27, 2018, 12:07 AM Dan ***@***.***> wrote:
[image: pip_freeze]
<https://user-images.githubusercontent.com/26237736/46122898-361c9000-c1d0-11e8-951e-2703fe9f1a70.PNG>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5873 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABkW_u6-dfZ77kc_-7H97XgAm4bj19scks5ufE8agaJpZM4VcUYr>
.
|
I'm using the kivy demo to test this. Uninstalling pypiwin32 does not fix the problem pywin32 is a dependency of pypiwin32 so both are needed for full functionality. Uninstalling both and not having either works, but you can no longer have win32 functions. |
@bmmcwhirt Are you perchance using 32 bit python? I can't seem to reproduce the issue on 3.7 64 bit. Also, I tested with |
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. |
@matham Have been getting this issue since June! You're right I am using 32-bit python! I'll try using 64-bit python |
I also have this issue (Python 3.7.2, Kivy 1.11.0.dev): Is the solution to downgrade to python 3.6? Here are the versions I have installed: certifi 2018.11.29 |
I believe switching to 64 bit allowed me to get passed this.
On Wed, Jan 23, 2019 at 7:09 AM, Dehole<notifications@github.com> wrote:
I also have this issue (Python 3.7.2, Kivy 1.11.0.dev):
Is the solution to downgrade to python 3.6?
Here are the versions I have installed:
certifi 2018.11.29
chardet 3.0.4
Cython 0.29.3
Django 2.1.5
docutils 0.14
ffpyplayer 4.1.0
idna 2.8
image 1.5.27
Kivy 1.11.0.dev0
Kivy-examples 1.11.0.dev0
Kivy-Garden 0.1.4
kivy.deps.glew 0.1.10
kivy.deps.gstreamer 0.1.13
kivy.deps.sdl2 0.1.18
numpy 1.16.0
pandas 0.23.4
Pillow 5.4.1
pip 19.0.1
Pygments 2.3.1
pypiwin32 223
pyserial 3.4
python-dateutil 2.7.5
pytz 2018.9
pywin32 224
requests 2.21.0
setuptools 40.6.3
six 1.12.0
urllib3 1.24.1
wheel 0.32.3
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
That's strange since I am running 64 bit of python. I have tried running the kivy examples in python 3.7.0 as well, with the same issues. I can upload whatever is needed to help troubleshoot this issue. |
Since switching to 64 bit seemd to have resolved my issue it has been awhile, but I'll test more tonight to verify my claim.
On Wed, Jan 23, 2019 at 8:13 AM, Dehole<notifications@github.com> wrote:
That's strange since I am running 64 bit of python. I have tried running the kivy examples in python 3.7.0 as well, with the same issues.
I can upload whatever is needed to help troubleshoot this issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Using 3.7.2 64 bit I no longer have an issue.
On Wednesday, January 23, 2019, 8:13:02 AM PST, Dehole <notifications@github.com> wrote:
That's strange since I am running 64 bit of python. I have tried running the kivy examples in python 3.7.0 as well, with the same issues.
I can upload whatever is needed to help troubleshoot this issue.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I was able to reproduce it and it seems that it is related to pygame being the Provider for the crashing version. When running RST_Editor from kivy-examples (and clicking Load):
For the crashing version (using pygame): `Fatal Python error: (pygame parachute) Segmentation Fault Current thread 0x00003e44 (most recent call first): The list of packages installed on the crashing version: altgraph 0.16.1 |
I fixed it by adding hiddenimports=['win32timezone'] to my .spec file. |
This question's answer seems to address the problem with .sys files in windows, by creating a filter: |
Running an edited version of example from the docs, see code below, the code does not crash and operates as expected. There are a set of log messages related to accessing hidden system files, these are also listed below.
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty
from kivy.uix.popup import Popup
import os
kv = """
Root:
text_input: text_input
BoxLayout:
orientation: 'vertical'
BoxLayout:
size_hint_y: None
height: 30
Button:
text: 'Load'
on_release: root.show_load()
Button:
text: 'Save'
on_release: root.show_save()
BoxLayout:
TextInput:
id: text_input
text: ''
RstDocument:
text: text_input.text
show_errors: True
<LoadDialog>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancel"
on_release: root.cancel()
Button:
text: "Load"
on_release: root.load(filechooser.path, filechooser.selection)
<SaveDialog>:
text_input: text_input
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
on_selection: text_input.text = self.selection and self.selection[0] or ''
TextInput:
id: text_input
size_hint_y: None
height: 30
multiline: False
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancel"
on_release: root.cancel()
Button:
text: "Save"
on_release: root.save(filechooser.path, text_input.text)
"""
class LoadDialog(FloatLayout):
load = ObjectProperty(None)
cancel = ObjectProperty(None)
class SaveDialog(FloatLayout):
save = ObjectProperty(None)
text_input = ObjectProperty(None)
cancel = ObjectProperty(None)
class Root(FloatLayout):
loadfile = ObjectProperty(None)
savefile = ObjectProperty(None)
text_input = ObjectProperty(None)
def dismiss_popup(self):
self._popup.dismiss()
def show_load(self):
content = LoadDialog(load=self.load, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def show_save(self):
content = SaveDialog(save=self.save, cancel=self.dismiss_popup)
self._popup = Popup(title="Save file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def load(self, path, filename):
with open(os.path.join(path, filename[0])) as stream:
self.text_input.text = stream.read()
self.dismiss_popup()
def save(self, path, filename):
with open(os.path.join(path, filename), 'w') as stream:
stream.write(self.text_input.text)
self.dismiss_popup()
class EditorApp(App):
def build(self):
return Builder.load_string(kv)
if __name__ == '__main__':
EditorApp().run() |
@ElliotGarbus: I would like to close this, but I am unsure.
@dehole @imalinkowskip @joyZombie @Dannylew12 Are any of you still encountering this with Kivy 2.2.1, and recent versions of the dependencies? |
@Julian-O The error messages in the log will only occur if the path in the FileChooser is set to the root (C:) directory in Windows. Set it to any other directory these messages will not be seen. I view this as a non-issue. I'm fine waiting to see if others are still experiencing an issue. Edit: It might be reasonable to consider if the log messages should be changed to warning (or even info) from error. |
@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:
|
Sort imports according to PEP8. Use built-in `os.stat` instead of win32file's `GetFileAttributesExW()` because it handles (in use) system files. ^ Fixes kivy#5873 Stop (conditionally) importing win32file. Add support for macOS's UF_Hidden attributes. Confirm new tests are now passing on Windows.
* 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 built-in `os.stat` instead of win32file's `GetFileAttributesExW()` because it handles (in use) system files. * Sort imports according to PEP8. * Stop (conditionally) importing win32file. * Add support for macOS's UF_Hidden attributes. * Confirm new tests are now passing.
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. |
Versions
Description
After the file selector popup happens the program crashes. The same code has no issue on python 3.6.
Code and Logs
The text was updated successfully, but these errors were encountered: