We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Streamlink no longer provides streamlink-script.py
As of version 0.14.0 streamlink does not install the streamlink-script.py script,
because of this streamlink-twitch-gui does not work as it cannot load the script.
This may an issue in streamlink, as there is no mention of its removal in the changelog.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
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.21.0,<3.0",
17     'urllib3[secure]>=1.23;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 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()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,7 @@
 #!/usr/bin/env python
 import codecs
-from os import environ
-from os import path
-from sys import path as sys_path
+from os import environ, path
+from sys import argv, path as sys_path
 
 from setuptools import setup, find_packages
 
@@ -53,6 +52,27 @@
 with codecs.open(path.join(this_directory, "README.md"), 'r', "utf8") as f:
     long_description = f.read()
 
+
+def is_wheel_for_windows():
+    if "bdist_wheel" in argv:
+        names = ["win32", "win-amd64", "cygwin"]
+        length = len(argv)
+        for pos in range(argv.index("bdist_wheel") + 1, length):
+            if argv[pos] == "--plat-name" and pos + 1 < length:
+                return argv[pos + 1] in names
+            elif argv[pos][:12] == "--plat-name=":
+                return argv[pos][12:] in names
+    return False
+
+
+entry_points = {
+    "console_scripts": ["streamlink=streamlink_cli.main:main"]
+}
+
+if is_wheel_for_windows():
+    entry_points["gui_scripts"] = ["streamlinkw=streamlink_cli.main:main"]
+
+
 setup(name="streamlink",
       version=versioneer.get_version(),
       cmdclass=versioneer.get_cmdclass(),
@@ -74,9 +94,7 @@
       license="Simplified BSD",
       packages=find_packages("src"),
       package_dir={"": "src"},
-      entry_points={
-          "console_scripts": ["streamlink=streamlink_cli.main:main"]
-      },
+      entry_points=entry_points,
       install_requires=deps,
       test_suite="tests",
       python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -1,8 +1,7 @@\n #!/usr/bin/env python\n import codecs\n-from os import environ\n-from os import path\n-from sys import path as sys_path\n+from os import environ, path\n+from sys import argv, path as sys_path\n \n from setuptools import setup, find_packages\n \n@@ -53,6 +52,27 @@\n with codecs.open(path.join(this_directory, \"README.md\"), 'r', \"utf8\") as f:\n     long_description = f.read()\n \n+\n+def is_wheel_for_windows():\n+    if \"bdist_wheel\" in argv:\n+        names = [\"win32\", \"win-amd64\", \"cygwin\"]\n+        length = len(argv)\n+        for pos in range(argv.index(\"bdist_wheel\") + 1, length):\n+            if argv[pos] == \"--plat-name\" and pos + 1 < length:\n+                return argv[pos + 1] in names\n+            elif argv[pos][:12] == \"--plat-name=\":\n+                return argv[pos][12:] in names\n+    return False\n+\n+\n+entry_points = {\n+    \"console_scripts\": [\"streamlink=streamlink_cli.main:main\"]\n+}\n+\n+if is_wheel_for_windows():\n+    entry_points[\"gui_scripts\"] = [\"streamlinkw=streamlink_cli.main:main\"]\n+\n+\n setup(name=\"streamlink\",\n       version=versioneer.get_version(),\n       cmdclass=versioneer.get_cmdclass(),\n@@ -74,9 +94,7 @@\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+      entry_points=entry_points,\n       install_requires=deps,\n       test_suite=\"tests\",\n       python_requires=\">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4\",\n", "issue": "Streamlink no longer provides streamlink-script.py\nAs of version 0.14.0 streamlink does not install the streamlink-script.py script,\r\nbecause of this streamlink-twitch-gui does not work as it cannot load the script.\r\nThis may an issue in streamlink, as there is no mention of its removal in the changelog.\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.21.0,<3.0\",\n    'urllib3[secure]>=1.23;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"}], "after_files": [{"content": "#!/usr/bin/env python\nimport codecs\nfrom os import environ, path\nfrom sys import argv, 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.21.0,<3.0\",\n    'urllib3[secure]>=1.23;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\n\ndef is_wheel_for_windows():\n    if \"bdist_wheel\" in argv:\n        names = [\"win32\", \"win-amd64\", \"cygwin\"]\n        length = len(argv)\n        for pos in range(argv.index(\"bdist_wheel\") + 1, length):\n            if argv[pos] == \"--plat-name\" and pos + 1 < length:\n                return argv[pos + 1] in names\n            elif argv[pos][:12] == \"--plat-name=\":\n                return argv[pos][12:] in names\n    return False\n\n\nentry_points = {\n    \"console_scripts\": [\"streamlink=streamlink_cli.main:main\"]\n}\n\nif is_wheel_for_windows():\n    entry_points[\"gui_scripts\"] = [\"streamlinkw=streamlink_cli.main:main\"]\n\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=entry_points,\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"}]}