community icon indicating copy to clipboard operation
community copied to clipboard

Kivy App crashes when pressing ESC, back button (Android) or F1 (settings_key).

Open mati4693 opened this issue 1 year ago • 3 comments
trafficstars

Software Versions

  • Python: 3.12
  • OS: Windows 10
  • Kivy: 2.3.0
  • Kivy installation method: 24.1.1

Describe the bug When pressing ESC on Windows or the back button on Android, the app produces an error and crashes. When pressing F1 (settings_key) to open settings, and to close settings also crashes the app.

Expected behavior When pressing ESC on Windows or the back button on Android, the app shuts down with no errors. When pressing F1 (settings_key) to open settings, and to close settings also doesnt produce any errors.

To Reproduce Pressing ESC (Windows), the back button (Android) or double pressing the F1 key.

Code and Logs and screenshots When pressing ESC or back button.

   File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\kivy\app.py", line 1205, in _on_keyboard_settings
     return self.close_settings()
            ^^^^^^^^^^^^^^^^^^^^^
 TypeError: App.close_settings() missing 1 required positional argument: 'settings'

When pressing F1 two times.

   File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\kivy\app.py", line 1202, in _on_keyboard_settings
     self.close_settings()
            ^^^^^^^^^^^^^^^^^^^^^
 TypeError: App.close_settings() missing 1 required positional argument: 'settings'

Solution In app.py in the Kivy package replace these lines with this: Line 1202: self.close_settings(self) Line 1205: return self.close_settings(self)

Now it doesnt produce any errors. Please fix this in the next release of Kivy.

mati4693 avatar Jul 27 '24 11:07 mati4693

I can not reproduce this error. Please share code you used to observe this behavior.

ElliotGarbus avatar Jul 27 '24 14:07 ElliotGarbus

Sounds to me that you have stated an already existing class/function/variable with your App class. It can behave differently depending of the running OS.

kuzeyron avatar Jul 27 '24 15:07 kuzeyron

@mati4693 Would you please provide a simple example that reproduces this issue.

akshayaurora avatar Aug 08 '24 08:08 akshayaurora

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.

github-actions[bot] avatar Sep 20 '24 05:09 github-actions[bot]