Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions for file with init code #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion attach.py
Original file line number Diff line number Diff line change
@@ -38,6 +38,8 @@ def _attach_to_python_process_with_transport(pid, stdio_transport, control_trans
init_code_file.write(code)
init_code_file.flush()

os.chmod(init_code_file.name, 0o644)

run_python_code_in_process(pid, ('''
exec(open("%s").read(), {
"pystol_stdin": "%s",
@@ -72,4 +74,4 @@ def attach_to_python_process(pid):
control_transport.delete_files()
stdio_transport.delete_files()

return control_transport, stdio_transport
return control_transport, stdio_transport