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.
Error when trying to get a photo attachment in a mail
-
Long press on the photo, run Pythonista script
-
Try running apex_dump.py in place of your script to see exactly what mail is passing to you. Did you try with jpeg instead of PIL?
-
-
@ccc
Same errorUnicodeDecodeError: '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/BC53E549-355D-4E77-BC46-64C3D3E0BDAF/Pythonista3/Documents/t2.py", line 15, in <module>
main()
File "/private/var/mobile/Containers/Shared/AppGroup/BC53E549-355D-4E77-BC46-64C3D3E0BDAF/Pythonista3/Documents/t2.py", line 12, in main
print('{:<11} : {}'.format(name.partition('_')[2], func()))
File "/var/containers/Bundle/Application/606A7B2D-313E-48DB-BEB5-79336C85A91D/Pythonista3.app/Frameworks/PythonistaKit3.framework/pylib/site-packages/appex.py", line 38, in get_attachments
input_items = get_input()
SystemError: <built-in function get_input> returned a result with an error set -
If I use ViewExif, it functions but Pythonista 3 crashes
-
Forcing Python 2 functions! bug of Python 3?
-
Workaround is to make sure that
#! python2
is the first line of your script. -
That's what I did when I said it's ok in Python 2
-
As adviced by @ccc, this is ok even in Python 3
#img = appex.get_image() f = appex.get_attachments() img = Image.open(f[0])
-
A
SystemError
exception is nearly always a bug on my part. I'll look into it. -
Thanks
Not vital as workaround of @ccc solves it.