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.
appex.get_input> returned a result with an error set
-
I'm trying to capture text from Unread app, but appex.get_input() returns an error
#coding: utf-8 import appex appex.get_input()
Returns:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byteDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/B6AB638B-3B3D-4649-85A1-8E5C6F750259/Pythonista3/Documents/Scratchpad.py", line 4, in <module>
appex.get_input()
SystemError: <built-in function get_input> returned a result with an error setNeed help please!!
Thanks in advance.
-
I have made some more tests and I found this only happens when there is an image in the feed item. At least, when I try to use the "Image Histogram" it shows an histogram.
I also found a weird behavior while using the scratchpad and the console with the same feed item when it has an image. In the console I am able to print the title with
print appex.get_input()[0].get('title') `` But if try the same code in the scratchpad with:
#coding: utf-8
import appex
print(appex.get_input()[0].get('title'))I get an exception
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/B6AB638B-3B3D-4649-85A1-8E5C6F750259/Pythonista3/Documents/Scratchpad.py", line 6, in <module>
t = appex.get_input()[0].get('title')
SystemError: <built-in function get_input> returned a result with an error set
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byteDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/B6AB638B-3B3D-4649-85A1-8E5C6F750259/Pythonista3/Documents/Scratchpad.py", line 5, in <module>
print(appex.get_input()[0].get('title'))
SystemError: <built-in function get_input> returned a result with an error setWhat I am doing wrong?
-
.encode('utf-8') or .decode('utf-8') is probably your friend...
https://wiki.python.org/moin/UnicodeDecodeError
Also piles of similar entries in StackOverflow.
-
Are you using the App Store version or the beta? I suspect this might be a bug in the
appex
module that I already fixed in the beta, but I could be wrong. -
@omz I'm using the Appstore version.
I was told on slack that this is already solved in beta an I have already sign-up last month but didn't receive invitation yet.