@alias
https://github.com/ywangd/stash/pull/448#issuecomment-1570127499
I used the stash git with this PR and some monkey patches.
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.
@alias
https://github.com/ywangd/stash/pull/448#issuecomment-1570127499
I used the stash git with this PR and some monkey patches.
@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')
@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
When I used STASH's GIT, after a bunch of code adjustments, it finally raised this error.
stash: <class 'RuntimeError'>: Subprocesses are not supported on ios
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/62FE27F6-9E3C-4590-A6B4-5F0E44D523B4/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 546, in exec_py_file
exec (code, namespace, namespace)
File "../../../site-packages/stash/bin/git.py", line 757, in <module>
ns.func(args)
File "../../../site-packages/stash/bin/git.py", line 502, in git_commit
sha = porcelain.commit(repo, message=ns.message, author=ns.author).decode()
File "/private/var/mobile/Containers/Shared/AppGroup/62FE27F6-9E3C-4590-A6B4-5F0E44D523B4/Pythonista3/Documents/site-packages/stash/lib/dulwich/porcelain.py", line 369, in commit
return r.do_commit(
File "/private/var/mobile/Containers/Shared/AppGroup/62FE27F6-9E3C-4590-A6B4-5F0E44D523B4/Pythonista3/Documents/site-packages/stash/lib/dulwich/repo.py", line 909, in do_commit
self.hooks["pre-commit"].execute()
File "/private/var/mobile/Containers/Shared/AppGroup/62FE27F6-9E3C-4590-A6B4-5F0E44D523B4/Pythonista3/Documents/site-packages/stash/lib/dulwich/hooks.py", line 103, in execute
ret = subprocess.call([self.filepath] + list(args), cwd=self.cwd)
File "/var/containers/Bundle/Application/B0A78445-FF06-4D46-9F0F-450329F5D41D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/subprocess.py", line 346, in call
with Popen(*popenargs, **kwargs) as p:
File "/var/containers/Bundle/Application/B0A78445-FF06-4D46-9F0F-450329F5D41D/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/subprocess.py", line 764, in __init__
raise RuntimeError(f"Subprocesses are not supported on {sys.platform}")
RuntimeError: Subprocesses are not supported on ios
Although I am not sure, under Pythonista 3.3, it is possible to run STASH with Python 3 and use a modified version of GIT. Therefore, there should have been no unsupported issue in the past.
Actually, I don't really care about this issue.
I am just looking for a GIT that supports SSH and can be used in Pythonista 3.4 .
@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.
@DavinE
Me too.
sys.exit() always raise the key interrupt error.