Changeset 036c325 in trunk


Ignore:
Timestamp:
2014-09-01T18:39:57Z (11 years ago)
Author:
travis-tahoe <travis-tahoe@…>
Branches:
master
Children:
37d348a
Parents:
cc223d0
Message:

Suppress all UserWarnings?, not just ones with known messages. refs #2248

Signed-off-by: Daira Hopwood <daira@…>

Location:
src/allmydata
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/__init__.py

    rcc223d0 r036c325  
    156156    import warnings
    157157    from _auto_deps import package_imports, global_deprecation_messages, deprecation_messages, \
    158         user_warning_messages, runtime_warning_messages, warning_imports
     158        runtime_warning_messages, warning_imports
    159159
    160160    def package_dir(srcfile):
     
    166166    # must import the packages in order to check their versions and paths.
    167167
    168     # This is to suppress various DeprecationWarnings, UserWarnings, and RuntimeWarnings
     168    # This is to suppress all UserWarnings and various DeprecationWarnings and RuntimeWarnings
    169169    # (listed in _auto_deps.py).
     170
     171    warnings.filterwarnings("ignore", category=UserWarning, append=True)
    170172
    171173    for msg in global_deprecation_messages + deprecation_messages:
    172174        warnings.filterwarnings("ignore", category=DeprecationWarning, message=msg, append=True)
    173     for msg in user_warning_messages:
    174         warnings.filterwarnings("ignore", category=UserWarning, message=msg, append=True)
    175175    for msg in runtime_warning_messages:
    176176        warnings.filterwarnings("ignore", category=RuntimeWarning, message=msg, append=True)
     
    182182                pass
    183183    finally:
    184         # Leave suppressions for global_deprecation_messages active.
    185         for ign in runtime_warning_messages + user_warning_messages + deprecation_messages:
     184        # Leave suppressions for UserWarnings and global_deprecation_messages active.
     185        for ign in runtime_warning_messages + deprecation_messages:
    186186            warnings.filters.pop()
    187187
  • TabularUnified src/allmydata/_auto_deps.py

    rcc223d0 r036c325  
    3030    #   rekeying bug http://twistedmatrix.com/trac/ticket/4395
    3131    #
     32    # service-identity is necessary for Twisted and pyOpenSSL to be able to
     33    # verify PKI certificates.
     34    #
    3235    "Twisted >= 11.0.0",
     36    "service-identity",
    3337
    3438    # * foolscap < 0.5.1 had a performance bug which spent O(N**2) CPU for
     
    7276# These are in the order they should be listed by --version, etc.
    7377package_imports = [
    74     # package name      module name
    75     ('foolscap',        'foolscap'),
    76     ('pycryptopp',      'pycryptopp'),
    77     ('zfec',            'zfec'),
    78     ('Twisted',         'twisted'),
    79     ('Nevow',           'nevow'),
    80     ('zope.interface',  'zope.interface'),
    81     ('python',          None),
    82     ('platform',        None),
    83     ('pyOpenSSL',       'OpenSSL'),
    84     ('simplejson',      'simplejson'),
    85     ('pycrypto',        'Crypto'),
    86     ('pyasn1',          'pyasn1'),
    87     ('mock',            'mock'),
     78    # package name       module name
     79    ('foolscap',         'foolscap'),
     80    ('pycryptopp',       'pycryptopp'),
     81    ('zfec',             'zfec'),
     82    ('Twisted',          'twisted'),
     83    ('Nevow',            'nevow'),
     84    ('zope.interface',   'zope.interface'),
     85    ('python',           None),
     86    ('platform',         None),
     87    ('pyOpenSSL',        'OpenSSL'),
     88    ('simplejson',       'simplejson'),
     89    ('pycrypto',         'Crypto'),
     90    ('pyasn1',           'pyasn1'),
     91    ('mock',             'mock'),
     92    ('service-identity', 'service_identity')
    8893]
    8994
     
    119124]
    120125
    121 user_warning_messages = [
    122     "Hashing uninitialized InterfaceClass instance",
    123     "Reliable disconnection notification requires pywin32 215 or later",
    124     '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.',
    125 ]
    126 
    127126runtime_warning_messages = [
    128127    "Not using mpz_powm_sec.  You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.",
Note: See TracChangeset for help on using the changeset viewer.