diff options
Diffstat (limited to 'pipermail/pycrypto/2012q4/000646.html')
-rw-r--r-- | pipermail/pycrypto/2012q4/000646.html | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/pipermail/pycrypto/2012q4/000646.html b/pipermail/pycrypto/2012q4/000646.html new file mode 100644 index 0000000..593cb9b --- /dev/null +++ b/pipermail/pycrypto/2012q4/000646.html @@ -0,0 +1,134 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> + <HEAD> + <TITLE> [pycrypto] Inovking Depreciation warnings in Python + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20Inovking%20Depreciation%20warnings%20in%20Python&In-Reply-To=%3CCADKMUwkza4deyQ-ySR7%3DxFnzUMXZ5KLcXHPS212JL2Nu%3DZsXQw%40mail.gmail.com%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <style type="text/css"> + pre { + white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ + } + </style> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000637.html"> + <LINK REL="Next" HREF="000638.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[pycrypto] Inovking Depreciation warnings in Python</H1> + <B>Oz Nahum Tiram</B> + <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20Inovking%20Depreciation%20warnings%20in%20Python&In-Reply-To=%3CCADKMUwkza4deyQ-ySR7%3DxFnzUMXZ5KLcXHPS212JL2Nu%3DZsXQw%40mail.gmail.com%3E" + TITLE="[pycrypto] Inovking Depreciation warnings in Python">nahumoz at gmail.com + </A><BR> + <I>Wed Dec 5 22:42:14 PST 2012</I> + <P><UL> + <LI>Previous message: <A HREF="000637.html">[pycrypto] Inovking Depreciation warnings in Python +</A></li> + <LI>Next message: <A HREF="000638.html">[pycrypto] Inovking Depreciation warnings in Python +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#646">[ date ]</a> + <a href="thread.html#646">[ thread ]</a> + <a href="subject.html#646">[ subject ]</a> + <a href="author.html#646">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Hi, + +I am writing a software that uses Pycrypto. The library's ebsite it says that: + +><i> RandomPool is now deprecated +</I> +Older version would issue a depreciation warning. Now the code simply says: + + class RandomPool: + """Deprecated. Use Random.new() instead. + + See <A HREF="http://www.pycrypto.org/randpool-broken">http://www.pycrypto.org/randpool-broken</A> + """ + def __init__(self, numbytes = 160, cipher=None, hash=None, file=None): + warnings.warn("This application uses RandomPool, which is +BROKEN in older releases. See +<A HREF="http://www.pycrypto.org/randpool-broken">http://www.pycrypto.org/randpool-broken</A>", +RandomPool_DeprecationWarning) + +When I instantiate RandomPool I don't see any waring ... + + >>> RandomPool() + <Crypto.Util.randpool.RandomPool instance at 0x7f498dac80e0> + +If I create a Class with `RandomPool_DeprecationWarning` I also don't +see a warning: + + >>> class Test(): + ... def __init__(self): + ... warnings.warn("This tests +RandomPool_DeprecationWarning", RandomPool_DeprecationWarning) + ... + >>> Test + <class __main__.Test at 0x7f498daecdb8> + +Compare to: + + >>> class Test2(): + ... def __init__(self): + ... warnings.warn("This application uses RandomPool, which +is BROKEN in older releases. See +<A HREF="http://www.pycrypto.org/randpool-broken">http://www.pycrypto.org/randpool-broken</A>", DeprecationWarning) + ... + >>> Test2() + <__main__.Test2 instance at 0x7f498dac8098> + +The code to `RandomPool_DeprecationWarning` + + class CryptoWarning(Warning): + """Base class for PyCrypto warnings""" + + class CryptoDeprecationWarning(DeprecationWarning, CryptoWarning): + """Base PyCrypto DeprecationWarning class""" + + class CryptoRuntimeWarning(RuntimeWarning, CryptoWarning): + """Base PyCrypto RuntimeWarning class""" + + # + # Warnings that we might actually use + # + + class RandomPool_DeprecationWarning(CryptoDeprecationWarning): + """Issued when Crypto.Util.randpool.RandomPool is instantiated.""" + +So my question is: +Why is `RandomPool_DeprecationWarning` quietly passing while +`DeprecationWarning` is not? + +(I am using Debian Wheezy, and Python 2.7.3) + + +Thanks, +Oz +</PRE> + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000637.html">[pycrypto] Inovking Depreciation warnings in Python +</A></li> + <LI>Next message: <A HREF="000638.html">[pycrypto] Inovking Depreciation warnings in Python +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#646">[ date ]</a> + <a href="thread.html#646">[ thread ]</a> + <a href="subject.html#646">[ subject ]</a> + <a href="author.html#646">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">More information about the pycrypto +mailing list</a><br> +</body></html> |