I suspect the scope of this UX "bug" is larger than python. I think this probably affects every executable written in an interpreted language and using a shebang. Here's another example with a bash script: $ cat > t.sh #!/bin/bash sed 's/\x0/\\0/g' # replaces null bytes with a visible '\0' $ ./t.sh s.sh #!/bin/bash echo $0 $ ./s.sh