@@ -0,0 +1,3106 @@
+%22%22%22Module containing bug report helper(s).%22%22%22%0Afrom __future__ import print_function%0A%0Aimport json%0Aimport platform%0Aimport sys%0Aimport ssl%0A%0Afrom . import __version__ as requests_version%0A%0Atry:%0A    from .packages.urllib3.contrib import pyopenssl%0Aexcept ImportError:%0A    pyopenssl = None%0A    OpenSSL = None%0A    cryptography = None%0Aelse:%0A    import OpenSSL%0A    import cryptography%0A%0A%0Adef _implementation():%0A    %22%22%22Return a dict with the Python implementation and verison.%0A%0A    Provide both the name and the version of the Python implementation%0A    currently running. For example, on CPython 2.7.5 it will return%0A    %7B'name': 'CPython', 'version': '2.7.5'%7D.%0A%0A    This function works best on CPython and PyPy: in particular, it probably%0A    doesn't work for Jython or IronPython. Future investigation should be done%0A    to work out the correct shape of the code for those platforms.%0A    %22%22%22%0A    implementation = platform.python_implementation()%0A%0A    if implementation == 'CPython':%0A        implementation_version = platform.python_version()%0A    elif implementation == 'PyPy':%0A        implementation_version = '%25s.%25s.%25s' %25 (sys.pypy_version_info.major,%0A                                               sys.pypy_version_info.minor,%0A                                               sys.pypy_version_info.micro)%0A        if sys.pypy_version_info.releaselevel != 'final':%0A            implementation_version = ''.join(%5B%0A                implementation_version, sys.pypy_version_info.releaselevel%0A                %5D)%0A    elif implementation == 'Jython':%0A        implementation_version = platform.python_version()  # Complete Guess%0A    elif implementation == 'IronPython':%0A        implementation_version = platform.python_version()  # Complete Guess%0A    else:%0A        implementation_version = 'Unknown'%0A%0A    return %7B'name': implementation, 'version': implementation_version%7D%0A%0A%0Adef information():%0A    %22%22%22Generate information for a bug report.%22%22%22%0A    try:%0A        platform_info = %7B%0A            'system': platform.system(),%0A            'release': platform.release(),%0A        %7D%0A    except IOError:%0A        platform_info = %7B%0A            'system': 'Unknown',%0A            'release': 'Unknown',%0A        %7D%0A%0A    implementation_info = _implementation()%0A    pyopenssl_info = %7B%0A        'version': None,%0A        'openssl_version': '',%0A    %7D%0A    if OpenSSL:%0A        pyopenssl_info = %7B%0A            'version': OpenSSL.__version__,%0A            'openssl_version': '%25x' %25 OpenSSL.SSL.OPENSSL_VERSION_NUMBER,%0A        %7D%0A    cryptography_info = %7B%0A        'version': getattr(cryptography, '__version__', ''),%0A    %7D%0A%0A    return %7B%0A        'platform': platform_info,%0A        'implementation': implementation_info,%0A        'system_ssl': %7B%0A            'version': '%25x' %25 ssl.OPENSSL_VERSION_NUMBER,%0A        %7D,%0A        'using_pyopenssl': pyopenssl is not None,%0A        'pyOpenSSL': pyopenssl_info,%0A        'cryptography': cryptography_info,%0A        'requests': %7B%0A            'version': requests_version,%0A        %7D,%0A    %7D%0A%0A%0Adef print_information():%0A    %22%22%22Pretty-print the bug information as JSON.%22%22%22%0A    print(json.dumps(information(), sort_keys=True, indent=2))%0A

Add debugging submodule for bug reporters