prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Really don't spam InsecurePlatformWarning
  urllib3 should configure its warnings using append=True to avoid overriding the user's preferences as specified with python -W or PYTHONWARNINGS.
  
  If this issue were fixed, the user could work around pypa/pip#2681 with
  
  ```
  export PYTHONWARNINGS="ignore:A true SSLContext object is not available"
  ```
  
  Additionally, the urllib3 docs are very unclear about why this is considered worth warning the end user about, particularly given that adding this strange message has effectively introduced a bug in hundreds of other projects.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `urllib3/__init__.py`
  Content:
  ```
  1 """
  2 urllib3 - Thread-safe connection pooling and re-using.
  3 """
  4 
  5 __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'
  6 __license__ = 'MIT'
  7 __version__ = '1.10.2'
  8 
  9 
  10 from .connectionpool import (
  11     HTTPConnectionPool,
  12     HTTPSConnectionPool,
  13     connection_from_url
  14 )
  15 
  16 from . import exceptions
  17 from .filepost import encode_multipart_formdata
  18 from .poolmanager import PoolManager, ProxyManager, proxy_from_url
  19 from .response import HTTPResponse
  20 from .util.request import make_headers
  21 from .util.url import get_host
  22 from .util.timeout import Timeout
  23 from .util.retry import Retry
  24 
  25 
  26 # Set default logging handler to avoid "No handler found" warnings.
  27 import logging
  28 try:  # Python 2.7+
  29     from logging import NullHandler
  30 except ImportError:
  31     class NullHandler(logging.Handler):
  32         def emit(self, record):
  33             pass
  34 
  35 logging.getLogger(__name__).addHandler(NullHandler())
  36 
  37 def add_stderr_logger(level=logging.DEBUG):
  38     """
  39     Helper for quickly adding a StreamHandler to the logger. Useful for
  40     debugging.
  41 
  42     Returns the handler after adding it.
  43     """
  44     # This method needs to be in this __init__.py to get the __name__ correct
  45     # even if urllib3 is vendored within another package.
  46     logger = logging.getLogger(__name__)
  47     handler = logging.StreamHandler()
  48     handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
  49     logger.addHandler(handler)
  50     logger.setLevel(level)
  51     logger.debug('Added a stderr logging handler to logger: %s' % __name__)
  52     return handler
  53 
  54 # ... Clean up.
  55 del NullHandler
  56 
  57 
  58 import warnings
  59 # SecurityWarning's always go off by default.
  60 warnings.simplefilter('always', exceptions.SecurityWarning)
  61 # InsecurePlatformWarning's don't vary between requests, so we keep it default.
  62 warnings.simplefilter('default', exceptions.InsecurePlatformWarning)
  63 
  64 def disable_warnings(category=exceptions.HTTPWarning):
  65     """
  66     Helper for quickly disabling all urllib3 warnings.
  67     """
  68     warnings.simplefilter('ignore', category)
  69
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/urllib3/__init__.py b/urllib3/__init__.py
  --- a/urllib3/__init__.py
  +++ b/urllib3/__init__.py
  @@ -57,9 +57,10 @@
   
   import warnings
   # SecurityWarning's always go off by default.
  -warnings.simplefilter('always', exceptions.SecurityWarning)
  +warnings.simplefilter('always', exceptions.SecurityWarning, append=True)
   # InsecurePlatformWarning's don't vary between requests, so we keep it default.
  -warnings.simplefilter('default', exceptions.InsecurePlatformWarning)
  +warnings.simplefilter('default', exceptions.InsecurePlatformWarning,
  +                      append=True)
   
   def disable_warnings(category=exceptions.HTTPWarning):
       """
  
verification_info: {"golden_diff": "diff --git a/urllib3/__init__.py b/urllib3/__init__.py\n--- a/urllib3/__init__.py\n+++ b/urllib3/__init__.py\n@@ -57,9 +57,10 @@\n \n import warnings\n # SecurityWarning's always go off by default.\n-warnings.simplefilter('always', exceptions.SecurityWarning)\n+warnings.simplefilter('always', exceptions.SecurityWarning, append=True)\n # InsecurePlatformWarning's don't vary between requests, so we keep it default.\n-warnings.simplefilter('default', exceptions.InsecurePlatformWarning)\n+warnings.simplefilter('default', exceptions.InsecurePlatformWarning,\n+                      append=True)\n \n def disable_warnings(category=exceptions.HTTPWarning):\n     \"\"\"\n", "issue": "Really don't spam InsecurePlatformWarning\nurllib3 should configure its warnings using append=True to avoid overriding the user's preferences as specified with python -W or PYTHONWARNINGS.\n\nIf this issue were fixed, the user could work around pypa/pip#2681 with\n\n```\nexport PYTHONWARNINGS=\"ignore:A true SSLContext object is not available\"\n```\n\nAdditionally, the urllib3 docs are very unclear about why this is considered worth warning the end user about, particularly given that adding this strange message has effectively introduced a bug in hundreds of other projects.\n\n", "before_files": [{"content": "\"\"\"\nurllib3 - Thread-safe connection pooling and re-using.\n\"\"\"\n\n__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'\n__license__ = 'MIT'\n__version__ = '1.10.2'\n\n\nfrom .connectionpool import (\n    HTTPConnectionPool,\n    HTTPSConnectionPool,\n    connection_from_url\n)\n\nfrom . import exceptions\nfrom .filepost import encode_multipart_formdata\nfrom .poolmanager import PoolManager, ProxyManager, proxy_from_url\nfrom .response import HTTPResponse\nfrom .util.request import make_headers\nfrom .util.url import get_host\nfrom .util.timeout import Timeout\nfrom .util.retry import Retry\n\n\n# Set default logging handler to avoid \"No handler found\" warnings.\nimport logging\ntry:  # Python 2.7+\n    from logging import NullHandler\nexcept ImportError:\n    class NullHandler(logging.Handler):\n        def emit(self, record):\n            pass\n\nlogging.getLogger(__name__).addHandler(NullHandler())\n\ndef add_stderr_logger(level=logging.DEBUG):\n    \"\"\"\n    Helper for quickly adding a StreamHandler to the logger. Useful for\n    debugging.\n\n    Returns the handler after adding it.\n    \"\"\"\n    # This method needs to be in this __init__.py to get the __name__ correct\n    # even if urllib3 is vendored within another package.\n    logger = logging.getLogger(__name__)\n    handler = logging.StreamHandler()\n    handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))\n    logger.addHandler(handler)\n    logger.setLevel(level)\n    logger.debug('Added a stderr logging handler to logger: %s' % __name__)\n    return handler\n\n# ... Clean up.\ndel NullHandler\n\n\nimport warnings\n# SecurityWarning's always go off by default.\nwarnings.simplefilter('always', exceptions.SecurityWarning)\n# InsecurePlatformWarning's don't vary between requests, so we keep it default.\nwarnings.simplefilter('default', exceptions.InsecurePlatformWarning)\n\ndef disable_warnings(category=exceptions.HTTPWarning):\n    \"\"\"\n    Helper for quickly disabling all urllib3 warnings.\n    \"\"\"\n    warnings.simplefilter('ignore', category)\n", "path": "urllib3/__init__.py"}], "after_files": [{"content": "\"\"\"\nurllib3 - Thread-safe connection pooling and re-using.\n\"\"\"\n\n__author__ = 'Andrey Petrov (andrey.petrov@shazow.net)'\n__license__ = 'MIT'\n__version__ = '1.10.2'\n\n\nfrom .connectionpool import (\n    HTTPConnectionPool,\n    HTTPSConnectionPool,\n    connection_from_url\n)\n\nfrom . import exceptions\nfrom .filepost import encode_multipart_formdata\nfrom .poolmanager import PoolManager, ProxyManager, proxy_from_url\nfrom .response import HTTPResponse\nfrom .util.request import make_headers\nfrom .util.url import get_host\nfrom .util.timeout import Timeout\nfrom .util.retry import Retry\n\n\n# Set default logging handler to avoid \"No handler found\" warnings.\nimport logging\ntry:  # Python 2.7+\n    from logging import NullHandler\nexcept ImportError:\n    class NullHandler(logging.Handler):\n        def emit(self, record):\n            pass\n\nlogging.getLogger(__name__).addHandler(NullHandler())\n\ndef add_stderr_logger(level=logging.DEBUG):\n    \"\"\"\n    Helper for quickly adding a StreamHandler to the logger. Useful for\n    debugging.\n\n    Returns the handler after adding it.\n    \"\"\"\n    # This method needs to be in this __init__.py to get the __name__ correct\n    # even if urllib3 is vendored within another package.\n    logger = logging.getLogger(__name__)\n    handler = logging.StreamHandler()\n    handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))\n    logger.addHandler(handler)\n    logger.setLevel(level)\n    logger.debug('Added a stderr logging handler to logger: %s' % __name__)\n    return handler\n\n# ... Clean up.\ndel NullHandler\n\n\nimport warnings\n# SecurityWarning's always go off by default.\nwarnings.simplefilter('always', exceptions.SecurityWarning, append=True)\n# InsecurePlatformWarning's don't vary between requests, so we keep it default.\nwarnings.simplefilter('default', exceptions.InsecurePlatformWarning,\n                      append=True)\n\ndef disable_warnings(category=exceptions.HTTPWarning):\n    \"\"\"\n    Helper for quickly disabling all urllib3 warnings.\n    \"\"\"\n    warnings.simplefilter('ignore', category)\n", "path": "urllib3/__init__.py"}]}