We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Do not overwrite global `bytes` in code or examples
It looks like there's a few places we overwrite `bytes` (the type identifier) with a local variable.

```
$ git grep -E -e '^ +bytes *=' -- '*.py'
pwnlib/commandline/disasm.py:81:        bytes   = disasm(dat, vma=safeeval.const(args.address), instructions=False, offset=False)
pwnlib/commandline/elfpatch.py:29:    bytes  = unhex(a.bytes)
pwnlib/elf/elf.py:195:    bytes = 4
```

And a few cases we do it in tests, which could have cross-test impact if the global state isn't reset (hint: it isn't).

```
~/pwntools $ git grep -E -e '^ +>>> bytes *=' -- '*.py'
pwnlib/runner.py:42:        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
pwnlib/runner.py:48:        >>> bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')
pwnlib/runner.py:87:        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pwnlib/runner.py`
Content:
```
1 from __future__ import absolute_import
2 from __future__ import division
3 
4 import os
5 import tempfile
6 
7 from pwnlib.context import LocalContext
8 from pwnlib.elf import ELF
9 from pwnlib.tubes.process import process
10 
11 __all__ = ['run_assembly', 'run_shellcode', 'run_assembly_exitcode', 'run_shellcode_exitcode']
12 
13 @LocalContext
14 def run_assembly(assembly):
15     """
16     Given an assembly listing, assemble and execute it.
17 
18     Returns:
19 
20         A :class:`pwnlib.tubes.process.process` tube to interact with the process.
21 
22     Example:
23 
24         >>> p = run_assembly('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
25         >>> p.wait_for_close()
26         >>> p.poll()
27         3
28 
29         >>> p = run_assembly('mov r0, #12; mov r7, #1; svc #0', arch='arm')
30         >>> p.wait_for_close()
31         >>> p.poll()
32         12
33     """
34     return ELF.from_assembly(assembly).process()
35 
36 @LocalContext
37 def run_shellcode(bytes, **kw):
38     """Given assembled machine code bytes, execute them.
39 
40     Example:
41 
42         >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
43         >>> p = run_shellcode(bytes)
44         >>> p.wait_for_close()
45         >>> p.poll()
46         3
47 
48         >>> bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')
49         >>> p = run_shellcode(bytes, arch='arm')
50         >>> p.wait_for_close()
51         >>> p.poll()
52         12
53     """
54     return ELF.from_bytes(bytes, **kw).process()
55 
56 @LocalContext
57 def run_assembly_exitcode(assembly):
58     """
59     Given an assembly listing, assemble and execute it, and wait for
60     the process to die.
61 
62     Returns:
63 
64         The exit code of the process.
65 
66     Example:
67 
68         >>> run_assembly_exitcode('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
69         3
70     """
71     p = run_assembly(assembly)
72     p.wait_for_close()
73     return p.poll()
74 
75 @LocalContext
76 def run_shellcode_exitcode(bytes):
77     """
78     Given assembled machine code bytes, execute them, and wait for
79     the process to die.
80 
81     Returns:
82 
83         The exit code of the process.
84 
85     Example:
86 
87         >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
88         >>> run_shellcode_exitcode(bytes)
89         3
90     """
91     p = run_shellcode(bytes)
92     p.wait_for_close()
93     return p.poll()
94
```
--- 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/pwnlib/runner.py b/pwnlib/runner.py
--- a/pwnlib/runner.py
+++ b/pwnlib/runner.py
@@ -39,14 +39,14 @@
 
     Example:
 
-        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
-        >>> p = run_shellcode(bytes)
+        >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
+        >>> p = run_shellcode(insn_bytes)
         >>> p.wait_for_close()
         >>> p.poll()
         3
 
-        >>> bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')
-        >>> p = run_shellcode(bytes, arch='arm')
+        >>> insn_bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')
+        >>> p = run_shellcode(insn_bytes, arch='arm')
         >>> p.wait_for_close()
         >>> p.poll()
         12
@@ -84,8 +84,8 @@
 
     Example:
 
-        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
-        >>> run_shellcode_exitcode(bytes)
+        >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')
+        >>> run_shellcode_exitcode(insn_bytes)
         3
     """
     p = run_shellcode(bytes)

{"golden_diff": "diff --git a/pwnlib/runner.py b/pwnlib/runner.py\n--- a/pwnlib/runner.py\n+++ b/pwnlib/runner.py\n@@ -39,14 +39,14 @@\n \n     Example:\n \n-        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n-        >>> p = run_shellcode(bytes)\n+        >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n+        >>> p = run_shellcode(insn_bytes)\n         >>> p.wait_for_close()\n         >>> p.poll()\n         3\n \n-        >>> bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')\n-        >>> p = run_shellcode(bytes, arch='arm')\n+        >>> insn_bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')\n+        >>> p = run_shellcode(insn_bytes, arch='arm')\n         >>> p.wait_for_close()\n         >>> p.poll()\n         12\n@@ -84,8 +84,8 @@\n \n     Example:\n \n-        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n-        >>> run_shellcode_exitcode(bytes)\n+        >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n+        >>> run_shellcode_exitcode(insn_bytes)\n         3\n     \"\"\"\n     p = run_shellcode(bytes)\n", "issue": "Do not overwrite global `bytes` in code or examples\nIt looks like there's a few places we overwrite `bytes` (the type identifier) with a local variable.\r\n\r\n```\r\n$ git grep -E -e '^ +bytes *=' -- '*.py'\r\npwnlib/commandline/disasm.py:81:        bytes   = disasm(dat, vma=safeeval.const(args.address), instructions=False, offset=False)\r\npwnlib/commandline/elfpatch.py:29:    bytes  = unhex(a.bytes)\r\npwnlib/elf/elf.py:195:    bytes = 4\r\n```\r\n\r\nAnd a few cases we do it in tests, which could have cross-test impact if the global state isn't reset (hint: it isn't).\r\n\r\n```\r\n~/pwntools $ git grep -E -e '^ +>>> bytes *=' -- '*.py'\r\npwnlib/runner.py:42:        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\r\npwnlib/runner.py:48:        >>> bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')\r\npwnlib/runner.py:87:        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\r\n```\n", "before_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\n\nimport os\nimport tempfile\n\nfrom pwnlib.context import LocalContext\nfrom pwnlib.elf import ELF\nfrom pwnlib.tubes.process import process\n\n__all__ = ['run_assembly', 'run_shellcode', 'run_assembly_exitcode', 'run_shellcode_exitcode']\n\n@LocalContext\ndef run_assembly(assembly):\n    \"\"\"\n    Given an assembly listing, assemble and execute it.\n\n    Returns:\n\n        A :class:`pwnlib.tubes.process.process` tube to interact with the process.\n\n    Example:\n\n        >>> p = run_assembly('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        >>> p.wait_for_close()\n        >>> p.poll()\n        3\n\n        >>> p = run_assembly('mov r0, #12; mov r7, #1; svc #0', arch='arm')\n        >>> p.wait_for_close()\n        >>> p.poll()\n        12\n    \"\"\"\n    return ELF.from_assembly(assembly).process()\n\n@LocalContext\ndef run_shellcode(bytes, **kw):\n    \"\"\"Given assembled machine code bytes, execute them.\n\n    Example:\n\n        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        >>> p = run_shellcode(bytes)\n        >>> p.wait_for_close()\n        >>> p.poll()\n        3\n\n        >>> bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')\n        >>> p = run_shellcode(bytes, arch='arm')\n        >>> p.wait_for_close()\n        >>> p.poll()\n        12\n    \"\"\"\n    return ELF.from_bytes(bytes, **kw).process()\n\n@LocalContext\ndef run_assembly_exitcode(assembly):\n    \"\"\"\n    Given an assembly listing, assemble and execute it, and wait for\n    the process to die.\n\n    Returns:\n\n        The exit code of the process.\n\n    Example:\n\n        >>> run_assembly_exitcode('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        3\n    \"\"\"\n    p = run_assembly(assembly)\n    p.wait_for_close()\n    return p.poll()\n\n@LocalContext\ndef run_shellcode_exitcode(bytes):\n    \"\"\"\n    Given assembled machine code bytes, execute them, and wait for\n    the process to die.\n\n    Returns:\n\n        The exit code of the process.\n\n    Example:\n\n        >>> bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        >>> run_shellcode_exitcode(bytes)\n        3\n    \"\"\"\n    p = run_shellcode(bytes)\n    p.wait_for_close()\n    return p.poll()\n", "path": "pwnlib/runner.py"}], "after_files": [{"content": "from __future__ import absolute_import\nfrom __future__ import division\n\nimport os\nimport tempfile\n\nfrom pwnlib.context import LocalContext\nfrom pwnlib.elf import ELF\nfrom pwnlib.tubes.process import process\n\n__all__ = ['run_assembly', 'run_shellcode', 'run_assembly_exitcode', 'run_shellcode_exitcode']\n\n@LocalContext\ndef run_assembly(assembly):\n    \"\"\"\n    Given an assembly listing, assemble and execute it.\n\n    Returns:\n\n        A :class:`pwnlib.tubes.process.process` tube to interact with the process.\n\n    Example:\n\n        >>> p = run_assembly('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        >>> p.wait_for_close()\n        >>> p.poll()\n        3\n\n        >>> p = run_assembly('mov r0, #12; mov r7, #1; svc #0', arch='arm')\n        >>> p.wait_for_close()\n        >>> p.poll()\n        12\n    \"\"\"\n    return ELF.from_assembly(assembly).process()\n\n@LocalContext\ndef run_shellcode(bytes, **kw):\n    \"\"\"Given assembled machine code bytes, execute them.\n\n    Example:\n\n        >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        >>> p = run_shellcode(insn_bytes)\n        >>> p.wait_for_close()\n        >>> p.poll()\n        3\n\n        >>> insn_bytes = asm('mov r0, #12; mov r7, #1; svc #0', arch='arm')\n        >>> p = run_shellcode(insn_bytes, arch='arm')\n        >>> p.wait_for_close()\n        >>> p.poll()\n        12\n    \"\"\"\n    return ELF.from_bytes(bytes, **kw).process()\n\n@LocalContext\ndef run_assembly_exitcode(assembly):\n    \"\"\"\n    Given an assembly listing, assemble and execute it, and wait for\n    the process to die.\n\n    Returns:\n\n        The exit code of the process.\n\n    Example:\n\n        >>> run_assembly_exitcode('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        3\n    \"\"\"\n    p = run_assembly(assembly)\n    p.wait_for_close()\n    return p.poll()\n\n@LocalContext\ndef run_shellcode_exitcode(bytes):\n    \"\"\"\n    Given assembled machine code bytes, execute them, and wait for\n    the process to die.\n\n    Returns:\n\n        The exit code of the process.\n\n    Example:\n\n        >>> insn_bytes = asm('mov ebx, 3; mov eax, SYS_exit; int 0x80;')\n        >>> run_shellcode_exitcode(insn_bytes)\n        3\n    \"\"\"\n    p = run_shellcode(bytes)\n    p.wait_for_close()\n    return p.poll()\n", "path": "pwnlib/runner.py"}]}