Operating systems limit the shebang to a maximum number of bytes.
This patch makes the shebang-size check count raw bytes instead of UTF-8 characters.
Signed-off-by: Jan Garcia <j@n-garcia.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit
d4ac66c5cdaf971fb717cc5c5bf9aa51a787d412)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
return
if stanza.startswith(b'#!'):
- #Shebang not found
try:
- stanza = stanza.decode("utf-8")
+ stanza.decode("utf-8")
except UnicodeDecodeError:
#If it is not a text file, it is not a script
return