Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions identify/identify.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ def parse_shebang(bytesio: IO[bytes]) -> tuple[str, ...]:
cmd = cmd[2:]
elif cmd[:1] == ('/usr/bin/env',):
cmd = cmd[1:]
elif cmd[:1] == ('/bin/busybox',):
cmd = cmd[1:]

if cmd == ('nix-shell',):
return _parse_nix_shebang(bytesio, cmd)
Expand Down
1 change: 1 addition & 0 deletions tests/identify_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def test_file_is_text_does_not_exist(tmpdir):
(b'#!/usr/bin/env python', ('python',)),
(b'#! /usr/bin/python', ('/usr/bin/python',)),
(b'#!/usr/bin/foo python', ('/usr/bin/foo', 'python')),
(b'#!/bin/busybox sh', ('sh',)),
# despite this being invalid, setuptools will write shebangs like this
(b'#!"/path/with spaces/x" y', ('/path/with spaces/x', 'y')),
# this is apparently completely ok to embed quotes
Expand Down