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 several problems
-
Hello all,
My iPhone unfortunately installed the Pythonista 3.4 update today which I didn't really want to do....
I now have several problems which I hope to solve with you as soon as possible!- first I get an error message like this:
SyntaxWarning: "is" with a literal. Did you mean "=="?
Code:
If (i + 1) % 200 is 0 and querry_size > 205:
what does that mean before everything had worked ?
- Stash
when I try to run pip install mysql.connector in Stash I get the following error:
TypeError("unsuppoertd operand type(s) for +: 'OmniClass' and 'list'")
Failed to run setup.py
Fall back to directory guessing ...
Error: cannot locate packages. Manual installation required.
how can I fix this ?
- view error...
I have a SafeAreaView as "main view" when I open it now with the Py 3.10 the app just closes without error message....
what I have now already tried from "which" point in the code the error occurs and that would be from said code:
set_menu(self.button_variable [ self.showSetting, self.hideSetting, ], long_press=True)
i found out with sys.exit() that it crashes from this code but i don't know why :(
I hope we can get this back somehow need the app for work :(
- first I get an error message like this:
-
@DavinE said in Pythonista 3.4 several problems:
SyntaxWarning: "is" with a literal
This is intentional: https://bugs.python.org/issue43151. Also, it's not an error, so the code still works. However, you should really be using
==
for equality comparison here. One of the few "valid" uses ofis
seems to be checking whether an object isNone
likething is None
.Not sure about the other ones, though.
-
As @ForceBru says, the fix for 1. is simple…
If (i + 1) % 200 is 0 and querry_size > 205: —> If (i + 1) % 200 == 0 and querry_size > 205:
Python 3.10 raises this warning (not an error) on all platforms (not just Pythonista) because identity is not the same thing as equality in Python.
>>> a = "Python" >>> a += "ista" >>> b = "Pythonista" >>> a == b True >>> a is b False >>> id(a), id(b) (4678064688, 4689446640)
For 2., there are compatibility issues with staSH but that utility is from https://github.com/ywangd/stash and is not built into Pythonista. Please open pull requests or issues there until compatibility with the current Pythonista is restored. I have done this as well but I am not a maintainer of that repo so I cannot merge changes.
For 3., you might try https://omz-software.com/pythonista/docs-3.4/py3/ios/ui.html#ui.in_background
If that does not help then try to create the shortest program possible (ideally 4 or 5 lines) that crashes and post that here so we can all see the crash.
-
@DavinE Did you check the content of file
_objc_exception.txt
in Pythonista local root after the crash? -
@ccc said in Pythonista 3.4 several problems:
As @ForceBru says, the fix for 1. is simple…
If (i + 1) % 200 is 0 and querry_size > 205: —> If (i + 1) % 200 == 0 and querry_size > 205:
Python 3.10 raises this warning (not an error) on all platforms (not just Pythonista) because identity is not the same thing as equality in Python.
>>> a = "Python" >>> a += "ista" >>> b = "Pythonista" >>> a == b True >>> a is b False >>> id(a), id(b) (4678064688, 4689446640)
@ccc, @ForceBru, Thanks for that 👍
For 2., there are compatibility issues with staSH but that utility is from https://github.com/ywangd/stash and is not built into Pythonista. Please open pull requests or issues there until compatibility with the current Pythonista is restored. I have done this as well but I am not a maintainer of that repo so I cannot merge changes.
@ccc, i opend an Issues with the error messages
For 3., you might try https://omz-software.com/pythonista/docs-3.4/py3/ios/ui.html#ui.in_background
If that does not help then try to create the shortest program possible (ideally 4 or 5 lines) that crashes and post that here so we can all see the crash.
@ccc does not worked for me... 😭
here is a example which crashes:import ui from anchors import SafeAreaView, dock, At, at, size_to_fit from ui3.menu import set_menu, Action from ui3.sfsymbol import SymbolImage class crash(SafeAreaView): def __init__(self): self.main_content = ui.View(frame=self.bounds, flex='WH') self.add_subview(self.main_content) self.button_area = ui.View(name='button_area') dock(self.button_area).bottom(self.main_content, At.TIGHT) at(self.button_area).height = at(self.button_area).fit_height self.name = 'test' self.background_color = 'blue' self.present('fullscreen', hide_title_bar=True) self.test() def test(self): button_1 = size_to_fit(ui.Button(name='button_1')) button_1.image = ui.Image('iow:ios7_people_32') button_1.width = button_1.height dock(button_1).bottom_left(self.button_area) at(self.button_area).height = at(self.button_area).fit_height open_view = Action('Einstellungsseite aufrufen', self.nothing, image=SymbolImage('gear')) close_view = Action('Einstellungsseite nicht aufrufen', self.nothing, image=SymbolImage('gear')) close_view.selected = True set_menu(button_1, [ open_view, close_view, ], long_press=True) def nothing(self): pass if __name__ == '__main__': crash()
-
@cvp said in Pythonista 3.4 several problems:
@DavinE Did you check the content of file
_objc_exception.txt
in Pythonista local root after the crash?I don't get this file 😭
-
@DavinE you have this error. To get this info, you have to use faulthandler from @dgelessus see here
Fatal Python error: Segmentation fault Current thread 0x00000001700b3000 (most recent call first): File "/var/containers/Bundle/Application/47EE896D-6D79-4316-83F7-36C4982BF508/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/pythonista/objc_util.py", line 898 in __call__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 155 in create_or_update File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 144 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 167 in set_menu File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/MesTests/a6.py", line 31 in test File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/MesTests/a6.py", line 19 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/MesTests/a6.py", line 40 in <module> Extension modules: pykit_io, _ui, _appex, _frameworksimporter, console, _debugger_ui, _clipboard, _dialogs (total: 8)
Thus, perhaps you need to open an issue in ui3.menu for @mikael
-
@cvp said in Pythonista 3.4 several problems:
@DavinE you have this error. To get this info, you have to use faulthandler from @dgelessus see here
Fatal Python error: Segmentation fault Current thread 0x00000001700b3000 (most recent call first): File "/var/containers/Bundle/Application/47EE896D-6D79-4316-83F7-36C4982BF508/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/pythonista/objc_util.py", line 898 in __call__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 155 in create_or_update File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 144 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 167 in set_menu File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/MesTests/a6.py", line 31 in test File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/MesTests/a6.py", line 19 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/MesTests/a6.py", line 40 in <module> Extension modules: pykit_io, _ui, _appex, _frameworksimporter, console, _debugger_ui, _clipboard, _dialogs (total: 8)
got it:
Fatal Python error: Segmentation fault Current thread 0x000000016da5b000 (most recent call first): File "/var/containers/Bundle/Application/872E2289-CF4B-43A6-BA49-E163FB9FA4F0/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/pythonista/objc_util.py", line 898 in __call__ File "/private/var/mobile/Containers/Shared/AppGroup/7502F935-14D3-4DA1-9D3B-1D998BE8A1E2/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 155 in create_or_update File "/private/var/mobile/Containers/Shared/AppGroup/7502F935-14D3-4DA1-9D3B-1D998BE8A1E2/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 144 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/7502F935-14D3-4DA1-9D3B-1D998BE8A1E2/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 167 in set_menu File "/private/var/mobile/Containers/Shared/AppGroup/7502F935-14D3-4DA1-9D3B-1D998BE8A1E2/Pythonista3/Documents/Barcode Scanner/Barcode Scanner.py", line 1033 in StartPage File "/private/var/mobile/Containers/Shared/AppGroup/7502F935-14D3-4DA1-9D3B-1D998BE8A1E2/Pythonista3/Documents/Barcode Scanner/Barcode Scanner.py", line 193 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/7502F935-14D3-4DA1-9D3B-1D998BE8A1E2/Pythonista3/Documents/Barcode Scanner/Barcode Scanner.py", line 28771 in <module> Extension modules: pykit_io, _ui, _appex, _frameworksimporter, _debugger_ui, console, sound, _photos, _photos2, _clipboard, _dialogs, _scene2 (total: 12)
Thus, perhaps you need to open an issue in ui3.menu for @mikael
Is @mikael still active ?
in github ? -
@DavinE Yes, he has answered today to an issue I posted in his WkWebView
But segmentation error is often not easy to solve.
-
@cvp said in Pythonista 3.4 several problems:
@DavinE Yes, he has answered today to an issue I posted in his WkWebView
But segmentation error is often not easy to solve.
Okay already once a good news but at the same time a bad if these errors are not easy to remove 🙈
-
@DavinE cool, be optimistic
-
@cvp, Must I otherwise I have a tearing problem
because of my problem with mysql.connector i have to wait too or here is no quick solution ?
-
-
@cvp said in Pythonista 3.4 several problems:
@DavinE problem seems to come from objc_util, if you check the fautlog, thus more for @omz
File "/var/containers/Bundle/Application/47EE896D-6D79-4316-83F7-36C4982BF508/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/pythonista/objc_util.py", line 898 in __call__
I can't say anything about that 😂
I do not really understand all this -
@DavinE said in Pythonista 3.4 several problems:
import ui from anchors import SafeAreaView, dock, At, at, size_to_fit from ui3.menu import set_menu, Action from ui3.sfsymbol import SymbolImage class crash(SafeAreaView): def __init__(self): self.main_content = ui.View(frame=self.bounds, flex='WH') self.add_subview(self.main_content) self.button_area = ui.View(name='button_area') dock(self.button_area).bottom(self.main_content, At.TIGHT) at(self.button_area).height = at(self.button_area).fit_height self.name = 'test' self.background_color = 'blue' self.present('fullscreen', hide_title_bar=True) self.test() def test(self): button_1 = size_to_fit(ui.Button(name='button_1')) button_1.image = ui.Image('iow:ios7_people_32') button_1.width = button_1.height dock(button_1).bottom_left(self.button_area) at(self.button_area).height = at(self.button_area).fit_height open_view = Action('Einstellungsseite aufrufen', self.nothing, image=SymbolImage('gear')) close_view = Action('Einstellungsseite nicht aufrufen', self.nothing, image=SymbolImage('gear')) close_view.selected = True set_menu(button_1, [ open_view, close_view, ], long_press=True) def nothing(self): pass if __name__ == '__main__': crash()
@mikael
Did you have time to look for it ?
I haven't heard anything on GitHub yet either 😭 -
@mikael @DavinE @omz Segmentation error
Fatal Python error: Segmentation fault Current thread 0x000000016fe83000 (most recent call first): File "/var/containers/Bundle/Application/47EE896D-6D79-4316-83F7-36C4982BF508/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/pythonista/objc_util.py", line 898 in __call__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 155 in create_or_update File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 144 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/site-packages-3/ui3/menu.py", line 166 in set_menu File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/a9.py", line 31 in test File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/a9.py", line 19 in __init__ File "/private/var/mobile/Containers/Shared/AppGroup/94C45A26-1F47-4486-9539-896F8F44AA91/Pythonista3/Documents/a9.py", line 40 in <module> Extension modules: pykit_io, _ui, _appex, _frameworksimporter, console, _debugger_ui, _pythonista, _photos, _photos2, _clipboard, _scene2, _dialogs (total: 12)