[Zope-dev] Python warnings behavior and stacklevel=2

Julien Anguenot ja at nuxeo.com
Fri Feb 10 09:15:38 EST 2006


Hi there,

I'm having some problems with the warnings module behavior.
(Python-2.4.2 and Zope-2.9 trunk)

[... traceback ... ]

   - Line 71
  Module zLOG, line 140, in LOG
  Module warnings, line 61, in warn
  Module warnings, line 67, in warn_explicit
TypeError: unsubscriptable object

It seems to be referenced on the Python tracker since Python-2.3.3. Has
been fixed and closed but has been updated in January this year.

https://sourceforge.net/tracker/?func=detail&atid=105470&aid=890010&group_id=5470

Specifying a stacklevel of  a workaround, instead of 2 within the
zLOG/__init__.py for instance1, as works fine. (and this seems to appear
within the Python but report)

I actually get the same error and behavior within CPS code using the
warnings module with a stacklevel of 2.

Has someone a proper way to fix this from Zope and / or Python or can we
simply change the StackLevel of the deprecation warnings to 1 waiting
for a proper fix in Python ?

Cheers,

	J.

-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
CPS Platform : http://www.cps-project.org
Zope3 / ECM   : http://www.z3lab.org
mail: anguenot at nuxeo.com; tel: +33 (0) 6 72 57 57 66

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20060210/fabffb69/signature.bin


More information about the Zope-Dev mailing list