[Python-checkins] r65721 - in python/trunk: Lib/cgi.py Misc/NEWS
brett.cannon
python-checkins at python.org
Sun Aug 17 00:00:31 CEST 2008
Author: brett.cannon
Date: Sun Aug 17 00:00:27 2008
New Revision: 65721
Log:
Silence DeprecationWarning raised by mimetools and rfc822 in cgi.
Modified:
python/trunk/Lib/cgi.py
python/trunk/Misc/NEWS
Modified: python/trunk/Lib/cgi.py
==============================================================================
--- python/trunk/Lib/cgi.py (original)
+++ python/trunk/Lib/cgi.py Sun Aug 17 00:00:27 2008
@@ -38,9 +38,16 @@
import sys
import os
import urllib
-import mimetools
-import rfc822
import UserDict
+from test.test_support import catch_warning
+from warnings import filterwarnings
+with catch_warning(record=False):
+ filterwarnings("ignore", ".*mimetools has been removed",
+ DeprecationWarning)
+ import mimetools
+ filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)
+ import rfc822
+
try:
from cStringIO import StringIO
except ImportError:
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Sun Aug 17 00:00:27 2008
@@ -49,7 +49,7 @@
-------
- Silence the DeprecationWarning raised when importing mimetools in
- BaseHTTPServer, httplib.
+ BaseHTTPServer, cgi (and rfc822), httplib.
- Issue #2776: fixed small issue when handling an URL with double slash
after a 302 response in the case of not going through a proxy.
More information about the Python-checkins
mailing list