We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Use the `gh` cli tool to create issues from `bugreport` if it's installed
Github has a CLI tool that can do things like create issues: https://cli.github.com/

When running pwndbg on a server, I can't do `bugreport --run-browser` because there's no X server running. I have to go through the issue creation process manually, copying and pasting the output. We could automate all of this using `gh issue create`.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pwndbg/commands/version.py`
Content:
```
1 """
2 Displays gdb, python and pwndbg versions.
3 """
4 
5 
6 import argparse
7 import sys
8 from platform import platform
9 from subprocess import check_output
10 from urllib.parse import quote
11 
12 import gdb
13 
14 import pwndbg
15 import pwndbg.commands
16 import pwndbg.ida
17 from pwndbg.color import message
18 
19 
20 def _gdb_version():
21     try:
22         return gdb.VERSION  # GDB >= 8.1 (or earlier?)
23     except AttributeError:
24         return gdb.execute("show version", to_string=True).split("\n")[0]
25 
26 
27 def _py_version():
28     return sys.version.replace("\n", " ")
29 
30 
31 def capstone_version():
32     try:
33         import capstone
34 
35         return ".".join(map(str, capstone.cs_version()))
36     except ImportError:
37         return "not found"
38 
39 
40 def unicorn_version():
41     try:
42         import unicorn
43 
44         return unicorn.__version__
45     except ImportError:
46         return "not found"
47 
48 
49 def all_versions():
50     gdb_str = "Gdb:      %s" % _gdb_version()
51     py_str = "Python:   %s" % _py_version()
52     pwndbg_str = "Pwndbg:   %s" % pwndbg.__version__
53 
54     capstone_str = "Capstone: %s" % capstone_version()
55     unicorn_str = "Unicorn:  %s" % unicorn_version()
56 
57     all_versions = (gdb_str, py_str, pwndbg_str, capstone_str, unicorn_str)
58 
59     ida_versions = pwndbg.ida.get_ida_versions()
60 
61     if ida_versions is not None:
62         ida_version = "IDA PRO:  %s" % ida_versions["ida"]
63         ida_py_ver = "IDA Py:   %s" % ida_versions["python"]
64         ida_hr_ver = "Hexrays:  %s" % ida_versions["hexrays"]
65         all_versions += (ida_version, ida_py_ver, ida_hr_ver)
66     return all_versions
67 
68 
69 @pwndbg.commands.ArgparsedCommand("Displays gdb, python and pwndbg versions.")
70 def version():
71     """
72     Displays gdb, python and pwndbg versions.
73     """
74     print("\n".join(map(message.system, all_versions())))
75 
76 
77 bugreport_parser = argparse.ArgumentParser(
78     description="""
79     Generate bugreport
80     """
81 )
82 bugreport_parser.add_argument(
83     "--run-browser", "-b", action="store_true", help="Open browser on github/issues/new"
84 )
85 
86 
87 @pwndbg.commands.ArgparsedCommand(bugreport_parser)
88 def bugreport(run_browser=False):
89     ISSUE_TEMPLATE = """
90 <!--
91 Before reporting a new issue, make sure that we do not have any duplicates already open.
92 If there is one it might be good to take part in the discussion there.
93 
94 Please make sure you have checked that the issue persists on LATEST pwndbg version.
95 
96 Below is a template for BUG REPORTS.
97 Don't include it if this is a FEATURE REQUEST.
98 -->
99 
100 
101 ### Description
102 
103 <!--
104 Briefly describe the problem you are having in a few paragraphs.
105 -->
106 
107 ### Steps to reproduce
108 
109 <!--
110 What do we have to do to reproduce the problem?
111 If this is connected to particular C/asm code or a binary,
112 please provide the binary or if possible, a smallest C code that reproduces the issue.
113 -->
114 
115 Gdb session history:
116 ```
117 {gdb_history}
118 ```
119 
120 ### My setup
121 
122 <!--
123 Show us your gdb/python/pwndbg/OS/IDA Pro version (depending on your case).
124 
125 NOTE: We are currently testing Pwndbg only on Ubuntu installations but it should work fine on other distros as well.
126 
127 This can be displayed in pwndbg through `version` command.
128 
129 If it is somehow unavailable, use:
130 * `show version` - for gdb
131 * `py import sys; print(sys.version)` - for python
132 * pwndbg version/git commit id
133 -->
134 
135 ```
136 {setup}
137 ```"""
138 
139     gdb_config = gdb.execute("show configuration", to_string=True).split("\n")
140     all_info = all_versions()
141 
142     current_setup = "Platform: %s\n" % platform()
143     current_setup += "\n".join(all_info)
144     current_setup += "\n" + "\n".join(gdb_config)
145 
146     # get saved history size (not including current gdb session)
147     gdb_history_file = gdb.execute("show history filename", to_string=True)
148     gdb_history_file = gdb_history_file[
149         gdb_history_file.index('"') + 1 : gdb_history_file.rindex('"')
150     ]
151     gdb_history_len = 0
152     try:
153         with open(gdb_history_file, "r") as f:
154             gdb_history_len = len(f.readlines())
155     except FileNotFoundError:
156         pass
157 
158     max_command_no = (
159         int(gdb.execute("show commands", to_string=True).split("\n")[-2].split()[0]) - 1
160     )
161     show_command_size = 10  # 'show command' returns 10 commands
162     gdb_current_session_history = {}
163     current_command_no = gdb_history_len + 1
164 
165     while current_command_no <= max_command_no:
166         cmds = gdb.execute(
167             "show commands " + str(current_command_no + (show_command_size // 2) + 1),
168             to_string=True,
169         ).split("\n")[:-1]
170         for cmd in cmds:
171             cmd_no, cmd = cmd.split(maxsplit=1)
172             cmd_no = int(cmd_no)
173             if cmd_no <= gdb_history_len:
174                 continue
175             if current_command_no > max_command_no:
176                 break
177             gdb_current_session_history[cmd_no] = cmd
178             current_command_no += 1
179 
180     gdb_current_session_history = (v for (k, v) in sorted(gdb_current_session_history.items()))
181     gdb_current_session_history = "\n".join(gdb_current_session_history)
182 
183     issue_bugreport = ISSUE_TEMPLATE.format(
184         gdb_history=gdb_current_session_history, setup=current_setup
185     )
186     print(issue_bugreport)
187 
188     please_please_submit = "Please submit the bugreport generated above at "
189     github_issue_url = "https://github.com/pwndbg/pwndbg/issues/new"
190     github_issue_body = "?body=" + quote(issue_bugreport)
191 
192     if run_browser:
193         try:
194             check_output(["xdg-open", github_issue_url + github_issue_body])
195         except Exception:
196             print(please_please_submit + github_issue_url)
197     else:
198         print(please_please_submit + github_issue_url)
199
```
--- 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/pwndbg/commands/version.py b/pwndbg/commands/version.py
--- a/pwndbg/commands/version.py
+++ b/pwndbg/commands/version.py
@@ -4,9 +4,12 @@
 
 
 import argparse
+import os
 import sys
 from platform import platform
+from subprocess import check_call
 from subprocess import check_output
+from tempfile import NamedTemporaryFile
 from urllib.parse import quote
 
 import gdb
@@ -79,13 +82,17 @@
     Generate bugreport
     """
 )
-bugreport_parser.add_argument(
+bugreport_group = bugreport_parser.add_mutually_exclusive_group()
+bugreport_group.add_argument(
     "--run-browser", "-b", action="store_true", help="Open browser on github/issues/new"
 )
+bugreport_group.add_argument(
+    "--use-gh", "-g", action="store_true", help="Create issue using Github CLI"
+)
 
 
 @pwndbg.commands.ArgparsedCommand(bugreport_parser)
-def bugreport(run_browser=False):
+def bugreport(run_browser=False, use_gh=False):
     ISSUE_TEMPLATE = """
 <!--
 Before reporting a new issue, make sure that we do not have any duplicates already open.
@@ -189,7 +196,17 @@
     github_issue_url = "https://github.com/pwndbg/pwndbg/issues/new"
     github_issue_body = "?body=" + quote(issue_bugreport)
 
-    if run_browser:
+    if use_gh:
+        try:
+            with NamedTemporaryFile("w", delete=True) as f:
+                f.write(issue_bugreport)
+                f.flush()
+                check_call([os.environ.get("EDITOR", "vi"), f.name])
+                check_call(["gh", "issue", "create", "--body-file", f.name])
+        except Exception:
+            print(please_please_submit + github_issue_url)
+            raise
+    elif run_browser:
         try:
             check_output(["xdg-open", github_issue_url + github_issue_body])
         except Exception:

{"golden_diff": "diff --git a/pwndbg/commands/version.py b/pwndbg/commands/version.py\n--- a/pwndbg/commands/version.py\n+++ b/pwndbg/commands/version.py\n@@ -4,9 +4,12 @@\n \n \n import argparse\n+import os\n import sys\n from platform import platform\n+from subprocess import check_call\n from subprocess import check_output\n+from tempfile import NamedTemporaryFile\n from urllib.parse import quote\n \n import gdb\n@@ -79,13 +82,17 @@\n     Generate bugreport\n     \"\"\"\n )\n-bugreport_parser.add_argument(\n+bugreport_group = bugreport_parser.add_mutually_exclusive_group()\n+bugreport_group.add_argument(\n     \"--run-browser\", \"-b\", action=\"store_true\", help=\"Open browser on github/issues/new\"\n )\n+bugreport_group.add_argument(\n+    \"--use-gh\", \"-g\", action=\"store_true\", help=\"Create issue using Github CLI\"\n+)\n \n \n @pwndbg.commands.ArgparsedCommand(bugreport_parser)\n-def bugreport(run_browser=False):\n+def bugreport(run_browser=False, use_gh=False):\n     ISSUE_TEMPLATE = \"\"\"\n <!--\n Before reporting a new issue, make sure that we do not have any duplicates already open.\n@@ -189,7 +196,17 @@\n     github_issue_url = \"https://github.com/pwndbg/pwndbg/issues/new\"\n     github_issue_body = \"?body=\" + quote(issue_bugreport)\n \n-    if run_browser:\n+    if use_gh:\n+        try:\n+            with NamedTemporaryFile(\"w\", delete=True) as f:\n+                f.write(issue_bugreport)\n+                f.flush()\n+                check_call([os.environ.get(\"EDITOR\", \"vi\"), f.name])\n+                check_call([\"gh\", \"issue\", \"create\", \"--body-file\", f.name])\n+        except Exception:\n+            print(please_please_submit + github_issue_url)\n+            raise\n+    elif run_browser:\n         try:\n             check_output([\"xdg-open\", github_issue_url + github_issue_body])\n         except Exception:\n", "issue": "Use the `gh` cli tool to create issues from `bugreport` if it's installed\nGithub has a CLI tool that can do things like create issues: https://cli.github.com/\r\n\r\nWhen running pwndbg on a server, I can't do `bugreport --run-browser` because there's no X server running. I have to go through the issue creation process manually, copying and pasting the output. We could automate all of this using `gh issue create`.\n", "before_files": [{"content": "\"\"\"\nDisplays gdb, python and pwndbg versions.\n\"\"\"\n\n\nimport argparse\nimport sys\nfrom platform import platform\nfrom subprocess import check_output\nfrom urllib.parse import quote\n\nimport gdb\n\nimport pwndbg\nimport pwndbg.commands\nimport pwndbg.ida\nfrom pwndbg.color import message\n\n\ndef _gdb_version():\n    try:\n        return gdb.VERSION  # GDB >= 8.1 (or earlier?)\n    except AttributeError:\n        return gdb.execute(\"show version\", to_string=True).split(\"\\n\")[0]\n\n\ndef _py_version():\n    return sys.version.replace(\"\\n\", \" \")\n\n\ndef capstone_version():\n    try:\n        import capstone\n\n        return \".\".join(map(str, capstone.cs_version()))\n    except ImportError:\n        return \"not found\"\n\n\ndef unicorn_version():\n    try:\n        import unicorn\n\n        return unicorn.__version__\n    except ImportError:\n        return \"not found\"\n\n\ndef all_versions():\n    gdb_str = \"Gdb:      %s\" % _gdb_version()\n    py_str = \"Python:   %s\" % _py_version()\n    pwndbg_str = \"Pwndbg:   %s\" % pwndbg.__version__\n\n    capstone_str = \"Capstone: %s\" % capstone_version()\n    unicorn_str = \"Unicorn:  %s\" % unicorn_version()\n\n    all_versions = (gdb_str, py_str, pwndbg_str, capstone_str, unicorn_str)\n\n    ida_versions = pwndbg.ida.get_ida_versions()\n\n    if ida_versions is not None:\n        ida_version = \"IDA PRO:  %s\" % ida_versions[\"ida\"]\n        ida_py_ver = \"IDA Py:   %s\" % ida_versions[\"python\"]\n        ida_hr_ver = \"Hexrays:  %s\" % ida_versions[\"hexrays\"]\n        all_versions += (ida_version, ida_py_ver, ida_hr_ver)\n    return all_versions\n\n\n@pwndbg.commands.ArgparsedCommand(\"Displays gdb, python and pwndbg versions.\")\ndef version():\n    \"\"\"\n    Displays gdb, python and pwndbg versions.\n    \"\"\"\n    print(\"\\n\".join(map(message.system, all_versions())))\n\n\nbugreport_parser = argparse.ArgumentParser(\n    description=\"\"\"\n    Generate bugreport\n    \"\"\"\n)\nbugreport_parser.add_argument(\n    \"--run-browser\", \"-b\", action=\"store_true\", help=\"Open browser on github/issues/new\"\n)\n\n\n@pwndbg.commands.ArgparsedCommand(bugreport_parser)\ndef bugreport(run_browser=False):\n    ISSUE_TEMPLATE = \"\"\"\n<!--\nBefore reporting a new issue, make sure that we do not have any duplicates already open.\nIf there is one it might be good to take part in the discussion there.\n\nPlease make sure you have checked that the issue persists on LATEST pwndbg version.\n\nBelow is a template for BUG REPORTS.\nDon't include it if this is a FEATURE REQUEST.\n-->\n\n\n### Description\n\n<!--\nBriefly describe the problem you are having in a few paragraphs.\n-->\n\n### Steps to reproduce\n\n<!--\nWhat do we have to do to reproduce the problem?\nIf this is connected to particular C/asm code or a binary,\nplease provide the binary or if possible, a smallest C code that reproduces the issue.\n-->\n\nGdb session history:\n```\n{gdb_history}\n```\n\n### My setup\n\n<!--\nShow us your gdb/python/pwndbg/OS/IDA Pro version (depending on your case).\n\nNOTE: We are currently testing Pwndbg only on Ubuntu installations but it should work fine on other distros as well.\n\nThis can be displayed in pwndbg through `version` command.\n\nIf it is somehow unavailable, use:\n* `show version` - for gdb\n* `py import sys; print(sys.version)` - for python\n* pwndbg version/git commit id\n-->\n\n```\n{setup}\n```\"\"\"\n\n    gdb_config = gdb.execute(\"show configuration\", to_string=True).split(\"\\n\")\n    all_info = all_versions()\n\n    current_setup = \"Platform: %s\\n\" % platform()\n    current_setup += \"\\n\".join(all_info)\n    current_setup += \"\\n\" + \"\\n\".join(gdb_config)\n\n    # get saved history size (not including current gdb session)\n    gdb_history_file = gdb.execute(\"show history filename\", to_string=True)\n    gdb_history_file = gdb_history_file[\n        gdb_history_file.index('\"') + 1 : gdb_history_file.rindex('\"')\n    ]\n    gdb_history_len = 0\n    try:\n        with open(gdb_history_file, \"r\") as f:\n            gdb_history_len = len(f.readlines())\n    except FileNotFoundError:\n        pass\n\n    max_command_no = (\n        int(gdb.execute(\"show commands\", to_string=True).split(\"\\n\")[-2].split()[0]) - 1\n    )\n    show_command_size = 10  # 'show command' returns 10 commands\n    gdb_current_session_history = {}\n    current_command_no = gdb_history_len + 1\n\n    while current_command_no <= max_command_no:\n        cmds = gdb.execute(\n            \"show commands \" + str(current_command_no + (show_command_size // 2) + 1),\n            to_string=True,\n        ).split(\"\\n\")[:-1]\n        for cmd in cmds:\n            cmd_no, cmd = cmd.split(maxsplit=1)\n            cmd_no = int(cmd_no)\n            if cmd_no <= gdb_history_len:\n                continue\n            if current_command_no > max_command_no:\n                break\n            gdb_current_session_history[cmd_no] = cmd\n            current_command_no += 1\n\n    gdb_current_session_history = (v for (k, v) in sorted(gdb_current_session_history.items()))\n    gdb_current_session_history = \"\\n\".join(gdb_current_session_history)\n\n    issue_bugreport = ISSUE_TEMPLATE.format(\n        gdb_history=gdb_current_session_history, setup=current_setup\n    )\n    print(issue_bugreport)\n\n    please_please_submit = \"Please submit the bugreport generated above at \"\n    github_issue_url = \"https://github.com/pwndbg/pwndbg/issues/new\"\n    github_issue_body = \"?body=\" + quote(issue_bugreport)\n\n    if run_browser:\n        try:\n            check_output([\"xdg-open\", github_issue_url + github_issue_body])\n        except Exception:\n            print(please_please_submit + github_issue_url)\n    else:\n        print(please_please_submit + github_issue_url)\n", "path": "pwndbg/commands/version.py"}], "after_files": [{"content": "\"\"\"\nDisplays gdb, python and pwndbg versions.\n\"\"\"\n\n\nimport argparse\nimport os\nimport sys\nfrom platform import platform\nfrom subprocess import check_call\nfrom subprocess import check_output\nfrom tempfile import NamedTemporaryFile\nfrom urllib.parse import quote\n\nimport gdb\n\nimport pwndbg\nimport pwndbg.commands\nimport pwndbg.ida\nfrom pwndbg.color import message\n\n\ndef _gdb_version():\n    try:\n        return gdb.VERSION  # GDB >= 8.1 (or earlier?)\n    except AttributeError:\n        return gdb.execute(\"show version\", to_string=True).split(\"\\n\")[0]\n\n\ndef _py_version():\n    return sys.version.replace(\"\\n\", \" \")\n\n\ndef capstone_version():\n    try:\n        import capstone\n\n        return \".\".join(map(str, capstone.cs_version()))\n    except ImportError:\n        return \"not found\"\n\n\ndef unicorn_version():\n    try:\n        import unicorn\n\n        return unicorn.__version__\n    except ImportError:\n        return \"not found\"\n\n\ndef all_versions():\n    gdb_str = \"Gdb:      %s\" % _gdb_version()\n    py_str = \"Python:   %s\" % _py_version()\n    pwndbg_str = \"Pwndbg:   %s\" % pwndbg.__version__\n\n    capstone_str = \"Capstone: %s\" % capstone_version()\n    unicorn_str = \"Unicorn:  %s\" % unicorn_version()\n\n    all_versions = (gdb_str, py_str, pwndbg_str, capstone_str, unicorn_str)\n\n    ida_versions = pwndbg.ida.get_ida_versions()\n\n    if ida_versions is not None:\n        ida_version = \"IDA PRO:  %s\" % ida_versions[\"ida\"]\n        ida_py_ver = \"IDA Py:   %s\" % ida_versions[\"python\"]\n        ida_hr_ver = \"Hexrays:  %s\" % ida_versions[\"hexrays\"]\n        all_versions += (ida_version, ida_py_ver, ida_hr_ver)\n    return all_versions\n\n\n@pwndbg.commands.ArgparsedCommand(\"Displays gdb, python and pwndbg versions.\")\ndef version():\n    \"\"\"\n    Displays gdb, python and pwndbg versions.\n    \"\"\"\n    print(\"\\n\".join(map(message.system, all_versions())))\n\n\nbugreport_parser = argparse.ArgumentParser(\n    description=\"\"\"\n    Generate bugreport\n    \"\"\"\n)\nbugreport_group = bugreport_parser.add_mutually_exclusive_group()\nbugreport_group.add_argument(\n    \"--run-browser\", \"-b\", action=\"store_true\", help=\"Open browser on github/issues/new\"\n)\nbugreport_group.add_argument(\n    \"--use-gh\", \"-g\", action=\"store_true\", help=\"Create issue using Github CLI\"\n)\n\n\n@pwndbg.commands.ArgparsedCommand(bugreport_parser)\ndef bugreport(run_browser=False, use_gh=False):\n    ISSUE_TEMPLATE = \"\"\"\n<!--\nBefore reporting a new issue, make sure that we do not have any duplicates already open.\nIf there is one it might be good to take part in the discussion there.\n\nPlease make sure you have checked that the issue persists on LATEST pwndbg version.\n\nBelow is a template for BUG REPORTS.\nDon't include it if this is a FEATURE REQUEST.\n-->\n\n\n### Description\n\n<!--\nBriefly describe the problem you are having in a few paragraphs.\n-->\n\n### Steps to reproduce\n\n<!--\nWhat do we have to do to reproduce the problem?\nIf this is connected to particular C/asm code or a binary,\nplease provide the binary or if possible, a smallest C code that reproduces the issue.\n-->\n\nGdb session history:\n```\n{gdb_history}\n```\n\n### My setup\n\n<!--\nShow us your gdb/python/pwndbg/OS/IDA Pro version (depending on your case).\n\nNOTE: We are currently testing Pwndbg only on Ubuntu installations but it should work fine on other distros as well.\n\nThis can be displayed in pwndbg through `version` command.\n\nIf it is somehow unavailable, use:\n* `show version` - for gdb\n* `py import sys; print(sys.version)` - for python\n* pwndbg version/git commit id\n-->\n\n```\n{setup}\n```\"\"\"\n\n    gdb_config = gdb.execute(\"show configuration\", to_string=True).split(\"\\n\")\n    all_info = all_versions()\n\n    current_setup = \"Platform: %s\\n\" % platform()\n    current_setup += \"\\n\".join(all_info)\n    current_setup += \"\\n\" + \"\\n\".join(gdb_config)\n\n    # get saved history size (not including current gdb session)\n    gdb_history_file = gdb.execute(\"show history filename\", to_string=True)\n    gdb_history_file = gdb_history_file[\n        gdb_history_file.index('\"') + 1 : gdb_history_file.rindex('\"')\n    ]\n    gdb_history_len = 0\n    try:\n        with open(gdb_history_file, \"r\") as f:\n            gdb_history_len = len(f.readlines())\n    except FileNotFoundError:\n        pass\n\n    max_command_no = (\n        int(gdb.execute(\"show commands\", to_string=True).split(\"\\n\")[-2].split()[0]) - 1\n    )\n    show_command_size = 10  # 'show command' returns 10 commands\n    gdb_current_session_history = {}\n    current_command_no = gdb_history_len + 1\n\n    while current_command_no <= max_command_no:\n        cmds = gdb.execute(\n            \"show commands \" + str(current_command_no + (show_command_size // 2) + 1),\n            to_string=True,\n        ).split(\"\\n\")[:-1]\n        for cmd in cmds:\n            cmd_no, cmd = cmd.split(maxsplit=1)\n            cmd_no = int(cmd_no)\n            if cmd_no <= gdb_history_len:\n                continue\n            if current_command_no > max_command_no:\n                break\n            gdb_current_session_history[cmd_no] = cmd\n            current_command_no += 1\n\n    gdb_current_session_history = (v for (k, v) in sorted(gdb_current_session_history.items()))\n    gdb_current_session_history = \"\\n\".join(gdb_current_session_history)\n\n    issue_bugreport = ISSUE_TEMPLATE.format(\n        gdb_history=gdb_current_session_history, setup=current_setup\n    )\n    print(issue_bugreport)\n\n    please_please_submit = \"Please submit the bugreport generated above at \"\n    github_issue_url = \"https://github.com/pwndbg/pwndbg/issues/new\"\n    github_issue_body = \"?body=\" + quote(issue_bugreport)\n\n    if use_gh:\n        try:\n            with NamedTemporaryFile(\"w\", delete=True) as f:\n                f.write(issue_bugreport)\n                f.flush()\n                check_call([os.environ.get(\"EDITOR\", \"vi\"), f.name])\n                check_call([\"gh\", \"issue\", \"create\", \"--body-file\", f.name])\n        except Exception:\n            print(please_please_submit + github_issue_url)\n            raise\n    elif run_browser:\n        try:\n            check_output([\"xdg-open\", github_issue_url + github_issue_body])\n        except Exception:\n            print(please_please_submit + github_issue_url)\n    else:\n        print(please_please_submit + github_issue_url)\n", "path": "pwndbg/commands/version.py"}]}