zopefoundation / zope.app.i18n

Persistent translation domains and message catalogs
Other
0 stars 5 forks source link

Fix DeprecationWarnings #2

Closed jamadden closed 5 years ago

jamadden commented 5 years ago

Reported as

zope/configuration/config.py:240: DeprecationWarning: IRegistered is deprecated. Import from zope.interface.interfaces
  obj = getattr(mod, oname)
zope/configuration/config.py:240: DeprecationWarning: IUnregistered is deprecated. Import from zope.interface.interfaces
  obj = getattr(mod, oname)

Which is not helpful. So if you edit zope.component's interfaces.py to remove the BWC import, you can find the real culprit here:

zope.configuration.exceptions.ConfigurationError: Invalid value for 'for'
    File "//zope/app/testing/ftesting.zcml", line 11.2-11.42
    File "//zope/app/zcmlfiles/configure.zcml", line 49.2-49.37
    File "//zope/app/i18n/configure.zcml", line 36.2-40.8
    zope.configuration.interfaces.InvalidToken: ImportError: Module zope.component.interfaces has no global IRegistered in '.interfaces.ILocalTranslationDomain            zope.component.interfaces.IRegistered'
jamadden commented 5 years ago

There's another one:

/home/travis/build/zopefoundation/zope.app.i18n/src/zope/app/i18n/tests/test_translationdomain.py:44: DeprecationWarning: IComponentLookup is deprecated. Import from zope.interface.interfaces
  from zope.component.interfaces import IComponentLookup
jamadden commented 5 years ago

And one from the standard library:

/home/travis/build/zopefoundation/zope.app.i18n/src/zope/app/i18n/tests/test_filters.py:133: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(ids, [b'a', b'b'])
mgedmin commented 5 years ago

Thank you!