What's that code supposed to be doing?? Why does open with need to rebuild menus on library change? A minimal change to avoid the exception would be to add
Code:
try:
from PyQt5 import sip
except ImportError:
import sip
if sip.isdeleted(action):
continue