Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Pythonista 3.4 error: KeyboardInterrupt
-
Hello all,
I have the following error in the new Pythonista version which worked in the previous version:
Traceback (most recent call last): File "/private/var/mobile/Containers/ Shared/AppGroup/ 7502F935-14D3-4DA1-9D3B-1D998BE8A1E2/ Pythonista3/Documents/BarcodeScanner/ Barcode Scanner.py" line 1202, in checkCloseButton ACTION Button sys.exit(1) File "/var/containers/Bundle/ Application/872E2289-CF4B-43A6-BA49- E163FB9FA4F0/Pythonista3.app/Frameworks/ Py3Kit. framework/pykit_startup.py" line 33, in exit raise KeyboardInterrupt(f'Exit: {arg}') KeyboardInterrupt: Exit: 1
-
@DavinE
Me too.
sys.exit() always raise the key interrupt error. -
@BSoD said in Pythonista 3.4 error: KeyboardInterrupt:
@DavinE
Me too.
sys.exit() always raise the key interrupt error.How did you get around that ?
Is there an alternative ? -
@DavinE
No.
But this error only occurs at the end of the program and has no actual impact.
So, until the official fixes this issue, you can temporarily ignore this error. -
@BSoD said in Pythonista 3.4 error: KeyboardInterrupt:
@DavinE
No.
But this error only occurs at the end of the program and has no actual impact.
So, until the official fixes this issue, you can temporarily ignore this error.Not in my case...
It crash at the middle why ever... 😤
-
hi there
i also got the same error
since i updated pythonista3 latest v3.4iphone 13 mini / iOS v15.6.1
any py program with input function has same results
in my case
main process is ok but the last sys.exit() got NG
Traceback (most recent call last):
line 647, in <module>
sys.exit()line 33, in exit
raise KeyboardInterrupt(f'Exit: {arg}')KeyboardInterrupt: Exit: 0
after that console is unstable
i wish fix that ...
-
-
@DavinE
I found a way to make the sys.exit work like old version.In pythonista 3.4, there is a new script named pykit_startup.py that override the sys.exit method to avoid app really exit, and backup it to sys._exit .
So, you can just restore sys.exit to make it work as before.
Add these codes before your main entry:import sys sys.exit = sys._exit
-
try: x() y = z except KeyboardInterrupt: pass
-
@ccc
Neither 'pass' nor 'try/except:pass' can truly exit the executing script.print('This should be shown.') try: sys.exit() except: pass print('This should NOT be shown')