From cb0604da608cba10ce9d43c214345df54117fecb Mon Sep 17 00:00:00 2001 From: Jonas Bardino Date: Wed, 29 Jan 2025 13:33:28 +0000 Subject: [PATCH] Manually merge PR189 to also work around the low-level bug (issue 187) with yaml used through the C-API specifically on Rocky 8. Follow-up to PR188 fixing the issue on Rocky 9. git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6205 b75ad72c-e7d7-11dd-a971-7dbc132099af --- mig/shared/serial.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mig/shared/serial.py b/mig/shared/serial.py index ded1ada81..ade4e6424 100644 --- a/mig/shared/serial.py +++ b/mig/shared/serial.py @@ -46,9 +46,10 @@ # seen in sshd+sftpsubsys sessions. Apparently there's a bug / C-API # incompatibility when using yaml in embedded python interpreters, # due to yaml using its own nested C-extensions. In practice it -# results in a metaclass conflict TypeError upon yaml re-init there -# like described in +# results in a metaclass conflict TypeError or SystemError upon yaml +# re-init there like described in # https://github.com/ros-drivers/rosserial/issues/450 +# On Rocky 9 it's the TypeError and on Rocky 8 the SystemError. try: import json except ImportError: @@ -57,7 +58,7 @@ import yaml except ImportError: yaml = None -except TypeError: +except (TypeError, SystemError): # NOTE: this should not really happen but it does with sshd+sftpsubsys in # our PAM module hooking into this code as described above. We don't # actually need yaml in that case so just silently ignore it here and