[Zope-dev] Dependency of zope.deprecation in zope.configuration

Tres Seaver tseaver at palladion.com
Thu Mar 5 00:56:36 EST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Baiju M wrote:
> Hi,
> 
>    zope.deprecation is used in zope.configuration *only* to turn
> off deprecation warning when accessing attribute of an object in
> one place.  But there is no test case or comment about when such
> a warning will occur.
> 
> I have pasted the relevant code here:
> 
>   def resolve(self, dottedname):
>       """Resolve a dotted name to an object."""
> 
>       ....
> 
>       try:
>           zope.deprecation.__show__.off()
>           obj = getattr(mod, oname)
>           zope.deprecation.__show__.on()
>           return obj
>       except AttributeError:
>           zope.deprecation.__show__.on()
>           # No such name, maybe it's a module that we still need to import
>           try:
>               return __import__(mname+'.'+oname, *_import_chickens)
>           except ImportError:
>               if sys.exc_info()[2].tb_next is not None:
>                   # ImportError was caused deeper
>                   raise
>               raise ConfigurationError(
>                   "ImportError: Module %s has no global %s" % (mname, oname))
> 
> Can anyone point the reasoning behind turning off deprecation
> warning there.  What kind of deprecation is expected, and why it
> should not be displayed ?

Stephan added that code in revision 29143, four years ago now.  He
actually added the deprecation framework in that same revision.  I would
rip it out and see what warnings happen during a big test run:
suppressing them doesn't look like a good plan to me.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJr2mU+gerLs4ltQ4RAt36AKCjWSU8tgWcLz/ldIOR1bhV+Y1MwgCgwyf6
uT2vXXedLl/YlVNiquIAWJI=
=dzwK
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list