MCPcopy
hub / github.com/pex-tool/pex / chmod_plus_x

Function chmod_plus_x

pex/executables.py:19–30  ·  view source on GitHub ↗

Equivalent of unix `chmod a+x path`

(path)

Source from the content-addressed store, hash-verified

17
18
19def chmod_plus_x(path):
20 # type: (Text) -> None
21 """Equivalent of unix `chmod a+x path`"""
22 path_mode = os.stat(path).st_mode
23 path_mode &= int("777", 8)
24 if path_mode & stat.S_IRUSR:
25 path_mode |= stat.S_IXUSR
26 if path_mode & stat.S_IRGRP:
27 path_mode |= stat.S_IXGRP
28 if path_mode & stat.S_IROTH:
29 path_mode |= stat.S_IXOTH
30 os.chmod(path, path_mode)
31
32
33_SHEBANG_MAGIC = b"#!"

Callers 15

install_scriptsFunction · 0.90
_chmodMethod · 0.90
writeMethod · 0.90
install_wheelFunction · 0.90
buildMethod · 0.90
_build_zipappMethod · 0.90
ensure_scienceFunction · 0.90
_fetch_stubFunction · 0.90
ensure_pexrcFunction · 0.90
test_zip_file_type_modeFunction · 0.90
zip_fixtureFunction · 0.90
assert_chroot_permsFunction · 0.90

Calls

no outgoing calls

Tested by 11

test_zip_file_type_modeFunction · 0.72
zip_fixtureFunction · 0.72
assert_chroot_permsFunction · 0.72
execute_scriptFunction · 0.72
test_is_exeFunction · 0.72
test_is_script_posixFunction · 0.72
test_is_python_scriptFunction · 0.72
shebang_too_longFunction · 0.72
scriptFunction · 0.72