prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Update dependencies with security vulnerabilities
  As mentioned here:
  https://github.com/streamlink/streamlink/pull/2199#issuecomment-447567326
  
  1. urllib3
     > Vulnerable versions: < 1.23
     > Patched version: 1.23
     > urllib3 before version 1.23 does not remove the Authorization HTTP header when following a cross-origin redirect (i.e., a redirect that differs in host, port, or scheme). This can allow for credentials in the Authorization header to be exposed to unintended hosts or transmitted in cleartext.
     https://nvd.nist.gov/vuln/detail/CVE-2018-20060
  2. requests
     > Vulnerable versions: <= 2.19.1
     > Patched version: 2.20.0
     > The Requests package through 2.19.1 before 2018-09-14 for Python sends an HTTP Authorization header to an http URI upon receiving a same-hostname https-to-http redirect, which makes it easier for remote attackers to discover credentials by sniffing the network.
     https://nvd.nist.gov/vuln/detail/CVE-2018-18074
  
  
  </issue>
  <code>
  [start of setup.py]
  1 #!/usr/bin/env python
  2 import codecs
  3 from os import environ
  4 from os import path
  5 from sys import path as sys_path
  6 
  7 from setuptools import setup, find_packages
  8 
  9 import versioneer
  10 
  11 deps = [
  12     # Require backport of concurrent.futures on Python 2
  13     'futures;python_version<"3.0"',
  14     # Require singledispatch on Python <3.4
  15     'singledispatch;python_version<"3.4"',
  16     "requests>=2.2,!=2.12.0,!=2.12.1,!=2.16.0,!=2.16.1,!=2.16.2,!=2.16.3,!=2.16.4,!=2.16.5,!=2.17.1,<3.0",
  17     'urllib3[secure]<1.23,>=1.21.1;python_version<"3.0"',
  18     "isodate",
  19     "websocket-client",
  20     # Support for SOCKS proxies
  21     "PySocks!=1.5.7,>=1.5.6",
  22     # win-inet-pton is missing a dependency in PySocks, this has been fixed but not released yet
  23     # Required due to missing socket.inet_ntop & socket.inet_pton method in Windows Python 2.x
  24     'win-inet-pton;python_version<"3.0" and platform_system=="Windows"',
  25     # shutil.get_terminal_size and which were added in Python 3.3
  26     'backports.shutil_which;python_version<"3.3"',
  27     'backports.shutil_get_terminal_size;python_version<"3.3"'
  28 ]
  29 
  30 # for encrypted streams
  31 if environ.get("STREAMLINK_USE_PYCRYPTO"):
  32     deps.append("pycrypto")
  33 else:
  34     # this version of pycryptodome is known to work and has a Windows wheel for py2.7, py3.3-3.6
  35     deps.append("pycryptodome>=3.4.3,<4")
  36 
  37 # for localization
  38 if environ.get("STREAMLINK_USE_PYCOUNTRY"):
  39     deps.append("pycountry")
  40 else:
  41     deps.append("iso-639")
  42     deps.append("iso3166")
  43 
  44 # When we build an egg for the Win32 bootstrap we don"t want dependency
  45 # information built into it.
  46 if environ.get("NO_DEPS"):
  47     deps = []
  48 
  49 this_directory = path.abspath(path.dirname(__file__))
  50 srcdir = path.join(this_directory, "src/")
  51 sys_path.insert(0, srcdir)
  52 
  53 with codecs.open(path.join(this_directory, "README.md"), 'r', "utf8") as f:
  54     long_description = f.read()
  55 
  56 setup(name="streamlink",
  57       version=versioneer.get_version(),
  58       cmdclass=versioneer.get_cmdclass(),
  59       description="Streamlink is command-line utility that extracts streams "
  60                   "from various services and pipes them into a video player of "
  61                   "choice.",
  62       long_description=long_description,
  63       long_description_content_type="text/markdown",
  64       url="https://github.com/streamlink/streamlink",
  65       project_urls={
  66           "Documentation": "https://streamlink.github.io/",
  67           "Tracker": "https://github.com/streamlink/streamlink/issues",
  68           "Source": "https://github.com/streamlink/streamlink",
  69           "Funding": "https://opencollective.com/streamlink"
  70       },
  71       author="Streamlink",
  72       # temp until we have a mailing list / global email
  73       author_email="charlie@charliedrage.com",
  74       license="Simplified BSD",
  75       packages=find_packages("src"),
  76       package_dir={"": "src"},
  77       entry_points={
  78           "console_scripts": ["streamlink=streamlink_cli.main:main"]
  79       },
  80       install_requires=deps,
  81       test_suite="tests",
  82       python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4",
  83       classifiers=["Development Status :: 5 - Production/Stable",
  84                    "License :: OSI Approved :: BSD License",
  85                    "Environment :: Console",
  86                    "Intended Audience :: End Users/Desktop",
  87                    "Operating System :: POSIX",
  88                    "Operating System :: Microsoft :: Windows",
  89                    "Operating System :: MacOS",
  90                    "Programming Language :: Python :: 2.7",
  91                    "Programming Language :: Python :: 3.4",
  92                    "Programming Language :: Python :: 3.5",
  93                    "Programming Language :: Python :: 3.6",
  94                    "Programming Language :: Python :: 3.7",
  95                    "Topic :: Internet :: WWW/HTTP",
  96                    "Topic :: Multimedia :: Sound/Audio",
  97                    "Topic :: Multimedia :: Video",
  98                    "Topic :: Utilities"])
  99
  [end of setup.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -13,8 +13,8 @@
       'futures;python_version<"3.0"',
       # Require singledispatch on Python <3.4
       'singledispatch;python_version<"3.4"',
  -    "requests>=2.2,!=2.12.0,!=2.12.1,!=2.16.0,!=2.16.1,!=2.16.2,!=2.16.3,!=2.16.4,!=2.16.5,!=2.17.1,<3.0",
  -    'urllib3[secure]<1.23,>=1.21.1;python_version<"3.0"',
  +    "requests>=2.21.0,<3.0",
  +    'urllib3[secure]>=1.23;python_version<"3.0"',
       "isodate",
       "websocket-client",
       # Support for SOCKS proxies
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -13,8 +13,8 @@\n     'futures;python_version<\"3.0\"',\n     # Require singledispatch on Python <3.4\n     'singledispatch;python_version<\"3.4\"',\n-    \"requests>=2.2,!=2.12.0,!=2.12.1,!=2.16.0,!=2.16.1,!=2.16.2,!=2.16.3,!=2.16.4,!=2.16.5,!=2.17.1,<3.0\",\n-    'urllib3[secure]<1.23,>=1.21.1;python_version<\"3.0\"',\n+    \"requests>=2.21.0,<3.0\",\n+    'urllib3[secure]>=1.23;python_version<\"3.0\"',\n     \"isodate\",\n     \"websocket-client\",\n     # Support for SOCKS proxies\n", "issue": "Update dependencies with security vulnerabilities\nAs mentioned here:\r\nhttps://github.com/streamlink/streamlink/pull/2199#issuecomment-447567326\r\n\r\n1. urllib3\r\n   > Vulnerable versions: < 1.23\r\n   > Patched version: 1.23\r\n   > urllib3 before version 1.23 does not remove the Authorization HTTP header when following a cross-origin redirect (i.e., a redirect that differs in host, port, or scheme). This can allow for credentials in the Authorization header to be exposed to unintended hosts or transmitted in cleartext.\r\n   https://nvd.nist.gov/vuln/detail/CVE-2018-20060\r\n2. requests\r\n   > Vulnerable versions: <= 2.19.1\r\n   > Patched version: 2.20.0\r\n   > The Requests package through 2.19.1 before 2018-09-14 for Python sends an HTTP Authorization header to an http URI upon receiving a same-hostname https-to-http redirect, which makes it easier for remote attackers to discover credentials by sniffing the network.\r\n   https://nvd.nist.gov/vuln/detail/CVE-2018-18074\r\n\n", "before_files": [{"content": "#!/usr/bin/env python\nimport codecs\nfrom os import environ\nfrom os import path\nfrom sys import path as sys_path\n\nfrom setuptools import setup, find_packages\n\nimport versioneer\n\ndeps = [\n    # Require backport of concurrent.futures on Python 2\n    'futures;python_version<\"3.0\"',\n    # Require singledispatch on Python <3.4\n    'singledispatch;python_version<\"3.4\"',\n    \"requests>=2.2,!=2.12.0,!=2.12.1,!=2.16.0,!=2.16.1,!=2.16.2,!=2.16.3,!=2.16.4,!=2.16.5,!=2.17.1,<3.0\",\n    'urllib3[secure]<1.23,>=1.21.1;python_version<\"3.0\"',\n    \"isodate\",\n    \"websocket-client\",\n    # Support for SOCKS proxies\n    \"PySocks!=1.5.7,>=1.5.6\",\n    # win-inet-pton is missing a dependency in PySocks, this has been fixed but not released yet\n    # Required due to missing socket.inet_ntop & socket.inet_pton method in Windows Python 2.x\n    'win-inet-pton;python_version<\"3.0\" and platform_system==\"Windows\"',\n    # shutil.get_terminal_size and which were added in Python 3.3\n    'backports.shutil_which;python_version<\"3.3\"',\n    'backports.shutil_get_terminal_size;python_version<\"3.3\"'\n]\n\n# for encrypted streams\nif environ.get(\"STREAMLINK_USE_PYCRYPTO\"):\n    deps.append(\"pycrypto\")\nelse:\n    # this version of pycryptodome is known to work and has a Windows wheel for py2.7, py3.3-3.6\n    deps.append(\"pycryptodome>=3.4.3,<4\")\n\n# for localization\nif environ.get(\"STREAMLINK_USE_PYCOUNTRY\"):\n    deps.append(\"pycountry\")\nelse:\n    deps.append(\"iso-639\")\n    deps.append(\"iso3166\")\n\n# When we build an egg for the Win32 bootstrap we don\"t want dependency\n# information built into it.\nif environ.get(\"NO_DEPS\"):\n    deps = []\n\nthis_directory = path.abspath(path.dirname(__file__))\nsrcdir = path.join(this_directory, \"src/\")\nsys_path.insert(0, srcdir)\n\nwith codecs.open(path.join(this_directory, \"README.md\"), 'r', \"utf8\") as f:\n    long_description = f.read()\n\nsetup(name=\"streamlink\",\n      version=versioneer.get_version(),\n      cmdclass=versioneer.get_cmdclass(),\n      description=\"Streamlink is command-line utility that extracts streams \"\n                  \"from various services and pipes them into a video player of \"\n                  \"choice.\",\n      long_description=long_description,\n      long_description_content_type=\"text/markdown\",\n      url=\"https://github.com/streamlink/streamlink\",\n      project_urls={\n          \"Documentation\": \"https://streamlink.github.io/\",\n          \"Tracker\": \"https://github.com/streamlink/streamlink/issues\",\n          \"Source\": \"https://github.com/streamlink/streamlink\",\n          \"Funding\": \"https://opencollective.com/streamlink\"\n      },\n      author=\"Streamlink\",\n      # temp until we have a mailing list / global email\n      author_email=\"charlie@charliedrage.com\",\n      license=\"Simplified BSD\",\n      packages=find_packages(\"src\"),\n      package_dir={\"\": \"src\"},\n      entry_points={\n          \"console_scripts\": [\"streamlink=streamlink_cli.main:main\"]\n      },\n      install_requires=deps,\n      test_suite=\"tests\",\n      python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4\",\n      classifiers=[\"Development Status :: 5 - Production/Stable\",\n                   \"License :: OSI Approved :: BSD License\",\n                   \"Environment :: Console\",\n                   \"Intended Audience :: End Users/Desktop\",\n                   \"Operating System :: POSIX\",\n                   \"Operating System :: Microsoft :: Windows\",\n                   \"Operating System :: MacOS\",\n                   \"Programming Language :: Python :: 2.7\",\n                   \"Programming Language :: Python :: 3.4\",\n                   \"Programming Language :: Python :: 3.5\",\n                   \"Programming Language :: Python :: 3.6\",\n                   \"Programming Language :: Python :: 3.7\",\n                   \"Topic :: Internet :: WWW/HTTP\",\n                   \"Topic :: Multimedia :: Sound/Audio\",\n                   \"Topic :: Multimedia :: Video\",\n                   \"Topic :: Utilities\"])\n", "path": "setup.py"}]}