We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Error running build_package.py
When running build_package, it fails as curl is not available:
```txt
Traceback (most recent call last):
  File "build_package.py", line 43, in <module>
    subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])
  File "/usr/lib/python3.8/subprocess.py", line 359, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'curl'
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `build_package.py`
Content:
```
1 # Copyright (c) Microsoft Corporation.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 import glob
16 import os
17 import shutil
18 import stat
19 import subprocess
20 import sys
21 import zipfile
22 
23 from playwright.path_utils import get_file_dirname
24 
25 driver_version_64 = "0.170.0-next.1605305660869"
26 driver_version_32 = "0.170.0-next.1605305685932"
27 
28 
29 def driver_version(platform: str) -> str:
30     return driver_version_32 if platform == "win32" else driver_version_64
31 
32 
33 if not os.path.exists("driver"):
34     os.makedirs("driver")
35 if not os.path.exists("playwright/driver"):
36     os.makedirs("playwright/driver")
37 
38 for platform in ["mac", "linux", "win32", "win32_x64"]:
39     zip_file = f"playwright-cli-{driver_version(platform)}-{platform}.zip"
40     if not os.path.exists("driver/" + zip_file):
41         url = "https://playwright.azureedge.net/builds/cli/next/" + zip_file
42         print("Fetching ", url)
43         subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])
44 
45 _dirname = get_file_dirname()
46 _build_dir = _dirname / "build"
47 if _build_dir.exists():
48     shutil.rmtree(_build_dir)
49 _dist_dir = _dirname / "dist"
50 if _dist_dir.exists():
51     shutil.rmtree(_dist_dir)
52 _egg_dir = _dirname / "playwright.egg-info"
53 if _egg_dir.exists():
54     shutil.rmtree(_egg_dir)
55 
56 subprocess.check_call("python setup.py sdist bdist_wheel", shell=True)
57 
58 base_wheel_location = glob.glob("dist/*.whl")[0]
59 without_platform = base_wheel_location[:-7]
60 
61 platform_map = {
62     "darwin": "mac",
63     "linux": "linux",
64     "win32": "win32_x64" if sys.maxsize > 2 ** 32 else "win32",
65 }
66 
67 for platform in ["mac", "linux", "win32", "win32_x64"]:
68     zip_file = f"driver/playwright-cli-{driver_version(platform)}-{platform}.zip"
69     with zipfile.ZipFile(zip_file, "r") as zip:
70         zip.extractall(f"driver/{platform}")
71     if platform_map[sys.platform] == platform:
72         with zipfile.ZipFile(zip_file, "r") as zip:
73             zip.extractall("playwright/driver")
74         for file in os.listdir("playwright/driver"):
75             if file == "playwright-cli" or file.startswith("ffmpeg"):
76                 print(f"playwright/driver/{file}")
77                 os.chmod(
78                     f"playwright/driver/{file}",
79                     os.stat(f"playwright/driver/{file}").st_mode | stat.S_IEXEC,
80                 )
81 
82     wheel = ""
83     if platform == "mac":
84         wheel = "macosx_10_13_x86_64.whl"
85     if platform == "linux":
86         wheel = "manylinux1_x86_64.whl"
87     if platform == "win32":
88         wheel = "win32.whl"
89     if platform == "win32_x64":
90         wheel = "win_amd64.whl"
91     wheel_location = without_platform + wheel
92     shutil.copy(base_wheel_location, wheel_location)
93     with zipfile.ZipFile(wheel_location, "a") as zip:
94         for file in os.listdir(f"driver/{platform}"):
95             from_location = f"driver/{platform}/{file}"
96             to_location = f"playwright/driver/{file}"
97             if file == "playwright-cli" or file.startswith("ffmpeg"):
98                 os.chmod(from_location, os.stat(from_location).st_mode | stat.S_IEXEC)
99             zip.write(from_location, to_location)
100 
101 os.remove(base_wheel_location)
102
```
--- 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/build_package.py b/build_package.py
--- a/build_package.py
+++ b/build_package.py
@@ -18,6 +18,7 @@
 import stat
 import subprocess
 import sys
+import urllib.request
 import zipfile
 
 from playwright.path_utils import get_file_dirname
@@ -40,7 +41,7 @@
     if not os.path.exists("driver/" + zip_file):
         url = "https://playwright.azureedge.net/builds/cli/next/" + zip_file
         print("Fetching ", url)
-        subprocess.check_call(["curl", url, "-o", "driver/" + zip_file])
+        urllib.request.urlretrieve(url, "driver/" + zip_file)
 
 _dirname = get_file_dirname()
 _build_dir = _dirname / "build"

{"golden_diff": "diff --git a/build_package.py b/build_package.py\n--- a/build_package.py\n+++ b/build_package.py\n@@ -18,6 +18,7 @@\n import stat\n import subprocess\n import sys\n+import urllib.request\n import zipfile\n \n from playwright.path_utils import get_file_dirname\n@@ -40,7 +41,7 @@\n     if not os.path.exists(\"driver/\" + zip_file):\n         url = \"https://playwright.azureedge.net/builds/cli/next/\" + zip_file\n         print(\"Fetching \", url)\n-        subprocess.check_call([\"curl\", url, \"-o\", \"driver/\" + zip_file])\n+        urllib.request.urlretrieve(url, \"driver/\" + zip_file)\n \n _dirname = get_file_dirname()\n _build_dir = _dirname / \"build\"\n", "issue": "Error running build_package.py\nWhen running build_package, it fails as curl is not available:\r\n```txt\r\nTraceback (most recent call last):\r\n  File \"build_package.py\", line 43, in <module>\r\n    subprocess.check_call([\"curl\", url, \"-o\", \"driver/\" + zip_file])\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 359, in check_call\r\n    retcode = call(*popenargs, **kwargs)\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 340, in call\r\n    with Popen(*popenargs, **kwargs) as p:\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 854, in __init__\r\n    self._execute_child(args, executable, preexec_fn, close_fds,\r\n  File \"/usr/lib/python3.8/subprocess.py\", line 1702, in _execute_child\r\n    raise child_exception_type(errno_num, err_msg, err_filename)\r\nFileNotFoundError: [Errno 2] No such file or directory: 'curl'\r\n```\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport glob\nimport os\nimport shutil\nimport stat\nimport subprocess\nimport sys\nimport zipfile\n\nfrom playwright.path_utils import get_file_dirname\n\ndriver_version_64 = \"0.170.0-next.1605305660869\"\ndriver_version_32 = \"0.170.0-next.1605305685932\"\n\n\ndef driver_version(platform: str) -> str:\n    return driver_version_32 if platform == \"win32\" else driver_version_64\n\n\nif not os.path.exists(\"driver\"):\n    os.makedirs(\"driver\")\nif not os.path.exists(\"playwright/driver\"):\n    os.makedirs(\"playwright/driver\")\n\nfor platform in [\"mac\", \"linux\", \"win32\", \"win32_x64\"]:\n    zip_file = f\"playwright-cli-{driver_version(platform)}-{platform}.zip\"\n    if not os.path.exists(\"driver/\" + zip_file):\n        url = \"https://playwright.azureedge.net/builds/cli/next/\" + zip_file\n        print(\"Fetching \", url)\n        subprocess.check_call([\"curl\", url, \"-o\", \"driver/\" + zip_file])\n\n_dirname = get_file_dirname()\n_build_dir = _dirname / \"build\"\nif _build_dir.exists():\n    shutil.rmtree(_build_dir)\n_dist_dir = _dirname / \"dist\"\nif _dist_dir.exists():\n    shutil.rmtree(_dist_dir)\n_egg_dir = _dirname / \"playwright.egg-info\"\nif _egg_dir.exists():\n    shutil.rmtree(_egg_dir)\n\nsubprocess.check_call(\"python setup.py sdist bdist_wheel\", shell=True)\n\nbase_wheel_location = glob.glob(\"dist/*.whl\")[0]\nwithout_platform = base_wheel_location[:-7]\n\nplatform_map = {\n    \"darwin\": \"mac\",\n    \"linux\": \"linux\",\n    \"win32\": \"win32_x64\" if sys.maxsize > 2 ** 32 else \"win32\",\n}\n\nfor platform in [\"mac\", \"linux\", \"win32\", \"win32_x64\"]:\n    zip_file = f\"driver/playwright-cli-{driver_version(platform)}-{platform}.zip\"\n    with zipfile.ZipFile(zip_file, \"r\") as zip:\n        zip.extractall(f\"driver/{platform}\")\n    if platform_map[sys.platform] == platform:\n        with zipfile.ZipFile(zip_file, \"r\") as zip:\n            zip.extractall(\"playwright/driver\")\n        for file in os.listdir(\"playwright/driver\"):\n            if file == \"playwright-cli\" or file.startswith(\"ffmpeg\"):\n                print(f\"playwright/driver/{file}\")\n                os.chmod(\n                    f\"playwright/driver/{file}\",\n                    os.stat(f\"playwright/driver/{file}\").st_mode | stat.S_IEXEC,\n                )\n\n    wheel = \"\"\n    if platform == \"mac\":\n        wheel = \"macosx_10_13_x86_64.whl\"\n    if platform == \"linux\":\n        wheel = \"manylinux1_x86_64.whl\"\n    if platform == \"win32\":\n        wheel = \"win32.whl\"\n    if platform == \"win32_x64\":\n        wheel = \"win_amd64.whl\"\n    wheel_location = without_platform + wheel\n    shutil.copy(base_wheel_location, wheel_location)\n    with zipfile.ZipFile(wheel_location, \"a\") as zip:\n        for file in os.listdir(f\"driver/{platform}\"):\n            from_location = f\"driver/{platform}/{file}\"\n            to_location = f\"playwright/driver/{file}\"\n            if file == \"playwright-cli\" or file.startswith(\"ffmpeg\"):\n                os.chmod(from_location, os.stat(from_location).st_mode | stat.S_IEXEC)\n            zip.write(from_location, to_location)\n\nos.remove(base_wheel_location)\n", "path": "build_package.py"}], "after_files": [{"content": "# Copyright (c) Microsoft Corporation.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nimport glob\nimport os\nimport shutil\nimport stat\nimport subprocess\nimport sys\nimport urllib.request\nimport zipfile\n\nfrom playwright.path_utils import get_file_dirname\n\ndriver_version_64 = \"0.170.0-next.1605305660869\"\ndriver_version_32 = \"0.170.0-next.1605305685932\"\n\n\ndef driver_version(platform: str) -> str:\n    return driver_version_32 if platform == \"win32\" else driver_version_64\n\n\nif not os.path.exists(\"driver\"):\n    os.makedirs(\"driver\")\nif not os.path.exists(\"playwright/driver\"):\n    os.makedirs(\"playwright/driver\")\n\nfor platform in [\"mac\", \"linux\", \"win32\", \"win32_x64\"]:\n    zip_file = f\"playwright-cli-{driver_version(platform)}-{platform}.zip\"\n    if not os.path.exists(\"driver/\" + zip_file):\n        url = \"https://playwright.azureedge.net/builds/cli/next/\" + zip_file\n        print(\"Fetching \", url)\n        urllib.request.urlretrieve(url, \"driver/\" + zip_file)\n\n_dirname = get_file_dirname()\n_build_dir = _dirname / \"build\"\nif _build_dir.exists():\n    shutil.rmtree(_build_dir)\n_dist_dir = _dirname / \"dist\"\nif _dist_dir.exists():\n    shutil.rmtree(_dist_dir)\n_egg_dir = _dirname / \"playwright.egg-info\"\nif _egg_dir.exists():\n    shutil.rmtree(_egg_dir)\n\nsubprocess.check_call(\"python setup.py sdist bdist_wheel\", shell=True)\n\nbase_wheel_location = glob.glob(\"dist/*.whl\")[0]\nwithout_platform = base_wheel_location[:-7]\n\nplatform_map = {\n    \"darwin\": \"mac\",\n    \"linux\": \"linux\",\n    \"win32\": \"win32_x64\" if sys.maxsize > 2 ** 32 else \"win32\",\n}\n\nfor platform in [\"mac\", \"linux\", \"win32\", \"win32_x64\"]:\n    zip_file = f\"driver/playwright-cli-{driver_version(platform)}-{platform}.zip\"\n    with zipfile.ZipFile(zip_file, \"r\") as zip:\n        zip.extractall(f\"driver/{platform}\")\n    if platform_map[sys.platform] == platform:\n        with zipfile.ZipFile(zip_file, \"r\") as zip:\n            zip.extractall(\"playwright/driver\")\n        for file in os.listdir(\"playwright/driver\"):\n            if file == \"playwright-cli\" or file.startswith(\"ffmpeg\"):\n                print(f\"playwright/driver/{file}\")\n                os.chmod(\n                    f\"playwright/driver/{file}\",\n                    os.stat(f\"playwright/driver/{file}\").st_mode | stat.S_IEXEC,\n                )\n\n    wheel = \"\"\n    if platform == \"mac\":\n        wheel = \"macosx_10_13_x86_64.whl\"\n    if platform == \"linux\":\n        wheel = \"manylinux1_x86_64.whl\"\n    if platform == \"win32\":\n        wheel = \"win32.whl\"\n    if platform == \"win32_x64\":\n        wheel = \"win_amd64.whl\"\n    wheel_location = without_platform + wheel\n    shutil.copy(base_wheel_location, wheel_location)\n    with zipfile.ZipFile(wheel_location, \"a\") as zip:\n        for file in os.listdir(f\"driver/{platform}\"):\n            from_location = f\"driver/{platform}/{file}\"\n            to_location = f\"playwright/driver/{file}\"\n            if file == \"playwright-cli\" or file.startswith(\"ffmpeg\"):\n                os.chmod(from_location, os.stat(from_location).st_mode | stat.S_IEXEC)\n            zip.write(from_location, to_location)\n\nos.remove(base_wheel_location)\n", "path": "build_package.py"}]}