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 3.4 (340006) beta: Paramiko exception about PY_SSIZE_T_CLEAN macro
-
Installed the new beta, and ran a script that worked fine under the AppStore version. Some quick searching suggests this relates to the Python 3.10. Anyone know how to fix?
Unknown exception: PY_SSIZE_T_CLEAN macro must be defined for '#' formats
Traceback (most recent call last):
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/paramiko/transport.py", line 1799, in run
self.kex_engine.parse_next(ptype, m)
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/paramiko/kex_gex.py", line 89, in parse_next
return self._parse_kexdh_gex_reply(m)
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/paramiko/kex_gex.py", line 246, in _parse_kexdh_gex_reply
self.transport._activate_outbound()
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/paramiko/transport.py", line 2136, in _activate_outbound
engine = self._get_cipher(self.local_cipher, key_out, IV_out)
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/paramiko/transport.py", line 1667, in _get_cipher
return self._cipher_info[name]['class'].new(key, self._cipher_info[name]['mode'], '', counter)
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/Crypto/Cipher/AES.py", line 96, in new
return AESCipher(key, *args, **kwargs)
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/Crypto/Cipher/AES.py", line 60, in init
blockalgo.BlockAlgo.init(self, _AES, key, *args, **kwargs)
File "/var/containers/Bundle/Application/31EBC43E-A8F2-4AD7-93EC-0403F990B57B/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/site-packages/Crypto/Cipher/blockalgo.py", line 142, in init
self._cipher = factory.new(key, *args, **kwargs)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats -
I have the same issue with one of my scripts. This is the code that is causing the error:
def pil_to_ui(img): with BytesIO() as bIO: img.save(bIO, 'png') return ui.Image.from_data(bIO.getvalue())
The last line seem to be the one triggering the error message.
-
@superrune the release notes mention the Pillow issue. The other one should be reported in TestFlight.
-
@JonB Thanks for replying. I am not that experienced in Python, so half of the release notes are cryptic to me 🙂 I see the notes mention saving to jpeg has issues, but my code does png. I guess it goes for the same?
-
@JonB Yep, I reported it before posting here. Just wanted to increase visibility.