This appears to be the behavior of the 'importlib' library. At least it is with version I've tried it in since 3.7. If in a new shell you just run:
import importlib
importlib.util # Fails!
You will get this 'util' unknown attribute error. It is only if you directly import the util module that this works. It can be imported with something like 'import imporlib.util' or 'from importlib import util'. So the following will work:
import importlib.util
importlib.util # Works!
Note that the examples in the importlib documentation at https://docs.python.org/3/library/importlib.html all show a direct import of importlib.util like this. (Apparently looking at the package code and bootstrap code at https://github.com/python/cpython/tree/master/Lib/importlib, the util module is not loaded by package __init__.)
Now as to why this may have changed in your case... Note that if importlib.util was previously directly imported, it would be available on the existing importlib package if your script later imported it. For example:
# Done from anywhere in Fusion or other addins
import importlib.util
# Done In your addin
import importlib
importlib.util # Works!
So it is possible that slight changes in addin loading order or timing, or changes in other scripts or internal code run in the same interpreter could result in this. But I believe if you directly import the util module, you won't be dependent on someone else previously having loaded it.
Kris
Kris Kaplan