mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-25 13:29:45 +00:00
Suppress all UserWarnings, not just ones with known messages. refs #2248
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
cc223d08fa
commit
036c325d35
@ -155,7 +155,7 @@ def normalized_version(verstr, what=None):
|
|||||||
def get_package_versions_and_locations():
|
def get_package_versions_and_locations():
|
||||||
import warnings
|
import warnings
|
||||||
from _auto_deps import package_imports, global_deprecation_messages, deprecation_messages, \
|
from _auto_deps import package_imports, global_deprecation_messages, deprecation_messages, \
|
||||||
user_warning_messages, runtime_warning_messages, warning_imports
|
runtime_warning_messages, warning_imports
|
||||||
|
|
||||||
def package_dir(srcfile):
|
def package_dir(srcfile):
|
||||||
return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
|
return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
|
||||||
@ -165,13 +165,13 @@ def get_package_versions_and_locations():
|
|||||||
# or any other bug that causes sys.path to be set up incorrectly. Therefore we
|
# or any other bug that causes sys.path to be set up incorrectly. Therefore we
|
||||||
# must import the packages in order to check their versions and paths.
|
# must import the packages in order to check their versions and paths.
|
||||||
|
|
||||||
# This is to suppress various DeprecationWarnings, UserWarnings, and RuntimeWarnings
|
# This is to suppress all UserWarnings and various DeprecationWarnings and RuntimeWarnings
|
||||||
# (listed in _auto_deps.py).
|
# (listed in _auto_deps.py).
|
||||||
|
|
||||||
|
warnings.filterwarnings("ignore", category=UserWarning, append=True)
|
||||||
|
|
||||||
for msg in global_deprecation_messages + deprecation_messages:
|
for msg in global_deprecation_messages + deprecation_messages:
|
||||||
warnings.filterwarnings("ignore", category=DeprecationWarning, message=msg, append=True)
|
warnings.filterwarnings("ignore", category=DeprecationWarning, message=msg, append=True)
|
||||||
for msg in user_warning_messages:
|
|
||||||
warnings.filterwarnings("ignore", category=UserWarning, message=msg, append=True)
|
|
||||||
for msg in runtime_warning_messages:
|
for msg in runtime_warning_messages:
|
||||||
warnings.filterwarnings("ignore", category=RuntimeWarning, message=msg, append=True)
|
warnings.filterwarnings("ignore", category=RuntimeWarning, message=msg, append=True)
|
||||||
try:
|
try:
|
||||||
@ -181,8 +181,8 @@ def get_package_versions_and_locations():
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
# Leave suppressions for global_deprecation_messages active.
|
# Leave suppressions for UserWarnings and global_deprecation_messages active.
|
||||||
for ign in runtime_warning_messages + user_warning_messages + deprecation_messages:
|
for ign in runtime_warning_messages + deprecation_messages:
|
||||||
warnings.filters.pop()
|
warnings.filters.pop()
|
||||||
|
|
||||||
packages = []
|
packages = []
|
||||||
|
@ -29,7 +29,11 @@ install_requires = [
|
|||||||
# * The SFTP frontend depends on Twisted 11.0.0 to fix the SSH server
|
# * The SFTP frontend depends on Twisted 11.0.0 to fix the SSH server
|
||||||
# rekeying bug http://twistedmatrix.com/trac/ticket/4395
|
# rekeying bug http://twistedmatrix.com/trac/ticket/4395
|
||||||
#
|
#
|
||||||
|
# service-identity is necessary for Twisted and pyOpenSSL to be able to
|
||||||
|
# verify PKI certificates.
|
||||||
|
#
|
||||||
"Twisted >= 11.0.0",
|
"Twisted >= 11.0.0",
|
||||||
|
"service-identity",
|
||||||
|
|
||||||
# * foolscap < 0.5.1 had a performance bug which spent O(N**2) CPU for
|
# * foolscap < 0.5.1 had a performance bug which spent O(N**2) CPU for
|
||||||
# transferring large mutable files of size N.
|
# transferring large mutable files of size N.
|
||||||
@ -85,6 +89,7 @@ package_imports = [
|
|||||||
('pycrypto', 'Crypto'),
|
('pycrypto', 'Crypto'),
|
||||||
('pyasn1', 'pyasn1'),
|
('pyasn1', 'pyasn1'),
|
||||||
('mock', 'mock'),
|
('mock', 'mock'),
|
||||||
|
('service-identity', 'service_identity')
|
||||||
]
|
]
|
||||||
|
|
||||||
def require_more():
|
def require_more():
|
||||||
@ -118,12 +123,6 @@ deprecation_messages = [
|
|||||||
"the sets module is deprecated",
|
"the sets module is deprecated",
|
||||||
]
|
]
|
||||||
|
|
||||||
user_warning_messages = [
|
|
||||||
"Hashing uninitialized InterfaceClass instance",
|
|
||||||
"Reliable disconnection notification requires pywin32 215 or later",
|
|
||||||
'You do not have the service_identity module installed. Please install it from <https://pypi.python.org/pypi/service_identity>. Without the service_identity module and a recent enough pyOpenSSL tosupport it, Twisted can perform only rudimentary TLS client hostnameverification. Many valid certificate/hostname mappings may be rejected.',
|
|
||||||
]
|
|
||||||
|
|
||||||
runtime_warning_messages = [
|
runtime_warning_messages = [
|
||||||
"Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.",
|
"Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.",
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user