Python 2.7, plone.app.upgrade==2.0.34, Products.ResourceRegistries installed:
After the call of to52beta1 import Products.ResourceRegistries fails with cannot import name "config" - even though config.py exists in Products.ResourceRegistries.
The reason: to52beta1 hacks the Python import machinery and brings it into an inconsistent state regarding Products.ResourceRegistries. The import machinery raises an ImportError for from m import n if n happens to be a module in sys.modules and is not an attribute of m. to52beta1 deletes Products.ResourceRegistries but lets Products.ResourceRegistries.config in sys.modules -- causing the inconsistency and the error above.
I recommend to remove all modules related to Products.ResourceRegistries from sys.modules in v52beta1 to properly clean up after the import machinery hack.
In recent versions (e.g. plone.app.upgrade==2.0.34), to52beta1 has got at its end an install_product('plone.staticresources'). This fails for us with the ImportError above (due to the import machinery inconsistency). Apparently, this ImportError is hidden by upper layers of the upgrade machinery (this likely should not happen).
The problems possibly only occur if Products.ResourceRegistries is installed.
Python 2.7,
plone.app.upgrade==2.0.34,Products.ResourceRegistriesinstalled:After the call of
to52beta1import Products.ResourceRegistriesfails withcannot import name "config"- even thoughconfig.pyexists inProducts.ResourceRegistries.The reason:
to52beta1hacks the Python import machinery and brings it into an inconsistent state regardingProducts.ResourceRegistries. The import machinery raises anImportErrorforfrom m import nif n happens to be a module insys.modulesand is not an attribute of m.to52beta1deletesProducts.ResourceRegistriesbut letsProducts.ResourceRegistries.configinsys.modules-- causing the inconsistency and the error above.I recommend to remove all modules related to
Products.ResourceRegistriesfromsys.modulesinv52beta1to properly clean up after the import machinery hack.In recent versions (e.g.
plone.app.upgrade==2.0.34),to52beta1has got at its end aninstall_product('plone.staticresources'). This fails for us with theImportErrorabove (due to the import machinery inconsistency). Apparently, thisImportErroris hidden by upper layers of the upgrade machinery (this likely should not happen).The problems possibly only occur if
Products.ResourceRegistriesis installed.