Lines Matching +full:shebang +full:- +full:command
1 """distutils.command.build_scripts
3 Implements the Distutils 'build_scripts' command."""
8 from distutils.core import Command
15 first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$')
17 class build_scripts(Command):
22 ('build-dir=', 'd', "directory to \"build\" (copy) to"),
69 log.debug("not copying %s (up-to-date)", script)
72 # Always open the file, but ignore failures in dry-run mode --
95 log.info("copying and adjusting %s -> %s", script,
107 shebang = b"#!" + executable + post_interp + b"\n"
108 # Python parser starts to read a script using UTF-8 until
109 # it gets a #coding:xxx cookie. The shebang has to be the
111 # written before. So the shebang has to be decodable from
112 # UTF-8.
114 shebang.decode('utf-8')
117 "The shebang ({!r}) is not decodable "
118 "from utf-8".format(shebang))
120 # #coding:xxx cookie), the shebang has to be decodable from
123 shebang.decode(encoding)
126 "The shebang ({!r}) is not decodable "
128 .format(shebang, encoding))
130 outf.write(shebang)