From: david-sarah Date: Sat, 29 May 2010 05:05:37 +0000 (-0700) Subject: Move suppression of DeprecationWarning about BaseException.message from sftpd.py... X-Git-Tag: trac-4400 X-Git-Url: https://git.rkrishnan.org/%5B/index.php?a=commitdiff_plain;h=8ed28a95e7386d153c76b196de9f47c9854cc949;p=tahoe-lafs%2Ftahoe-lafs.git Move suppression of DeprecationWarning about BaseException.message from sftpd.py to main __init__.py. Also, remove the global suppression of the 'integer argument expected, got float' warning, which turned out to be a bug. --- diff --git a/src/allmydata/__init__.py b/src/allmydata/__init__.py index 1f9a265b..acaeda27 100644 --- a/src/allmydata/__init__.py +++ b/src/allmydata/__init__.py @@ -35,11 +35,10 @@ finally: warnings.filters.pop() warnings.filters.pop() - +# This warning is generated by twisted, but not when it is imported, only on an error. warnings.filterwarnings("ignore", category=DeprecationWarning, - message="integer argument expected, got float", - append=True) - + message="BaseException.message has been deprecated as of Python 2.6", + module=".*twisted.*", append=True) __version__ = "unknown" try: diff --git a/src/allmydata/frontends/sftpd.py b/src/allmydata/frontends/sftpd.py index e0516d81..e44270d8 100644 --- a/src/allmydata/frontends/sftpd.py +++ b/src/allmydata/frontends/sftpd.py @@ -33,13 +33,6 @@ from allmydata.immutable.upload import FileHandle from pycryptopp.cipher.aes import AES -# twisted.conch.ssh.filetransfer generates this warning, but not when it is imported, -# only on an error. -import warnings -warnings.filterwarnings("ignore", category=DeprecationWarning, - message="BaseException.message has been deprecated as of Python 2.6", - module=".*filetransfer", append=True) - noisy = True use_foolscap_logging = True