Skip to content

Commit 0c1121d

Browse files
authored
FIX: Generated shebang with path to python invalid if path contains spaces (Gallopsled#2285)
* modify script shebang to accept path with white space * add changelog for 2271
1 parent dafd42b commit 0c1121d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ The table below shows which release corresponds to each branch, and what date th
9191

9292
## 4.11.1 (`stable`)
9393

94+
- [#2271][2271] FIX: Generated shebang with path to python invalid if path contains spaces
9495
- [#2272][2272] Fix `tube.clean_and_log` not logging buffered data
9596
- [#2281][2281] FIX: Getting right amount of data for search fix
9697

98+
[2271]: https://github.com/Gallopsled/pwntools/pull/2271
9799
[2272]: https://github.com/Gallopsled/pwntools/pull/2272
98100
[2281]: https://github.com/Gallopsled/pwntools/pull/2281
99101

pwnlib/util/misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def run_in_new_terminal(command, terminal=None, args=None, kill_at_exit=True, pr
382382
import os
383383
os.execve({argv0!r}, {argv!r}, os.environ)
384384
'''
385-
script = script.format(executable=sys.executable,
385+
script = script.format(executable='/bin/env ' * (' ' in sys.executable) + sys.executable,
386386
argv=command,
387387
argv0=which(command[0]))
388388
script = script.lstrip()

0 commit comments

Comments
 (0)