Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
a9387b05
Commit
a9387b05
authored
Sep 21, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: remove pointless eval() of ARGV0 environment variable.
parent
1411790f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
mitogen/core.py
mitogen/core.py
+2
-1
mitogen/fakessh.py
mitogen/fakessh.py
+1
-1
mitogen/master.py
mitogen/master.py
+1
-1
No files found.
mitogen/core.py
View file @
a9387b05
...
@@ -657,6 +657,7 @@ class Stream(BasicStream):
...
@@ -657,6 +657,7 @@ class Stream(BasicStream):
LOG
.
debug
(
'%r.on_shutdown(%r)'
,
self
,
broker
)
LOG
.
debug
(
'%r.on_shutdown(%r)'
,
self
,
broker
)
def
accept
(
self
,
rfd
,
wfd
):
def
accept
(
self
,
rfd
,
wfd
):
# TODO: what is this os.dup for?
self
.
receive_side
=
Side
(
self
,
os
.
dup
(
rfd
))
self
.
receive_side
=
Side
(
self
,
os
.
dup
(
rfd
))
self
.
transmit_side
=
Side
(
self
,
os
.
dup
(
wfd
))
self
.
transmit_side
=
Side
(
self
,
os
.
dup
(
wfd
))
set_cloexec
(
self
.
receive_side
.
fd
)
set_cloexec
(
self
.
receive_side
.
fd
)
...
@@ -1184,7 +1185,7 @@ class ExternalContext(object):
...
@@ -1184,7 +1185,7 @@ class ExternalContext(object):
self
.
router
.
register
(
self
.
parent
,
self
.
stream
)
self
.
router
.
register
(
self
.
parent
,
self
.
stream
)
sys
.
executable
,
=
eval
(
os
.
environ
.
pop
(
'ARGV0'
)
)
sys
.
executable
=
os
.
environ
.
pop
(
'ARGV0'
,
sys
.
executable
)
LOG
.
debug
(
'Connected to %s; my ID is %r, PID is %r'
,
LOG
.
debug
(
'Connected to %s; my ID is %r, PID is %r'
,
self
.
parent
,
context_id
,
os
.
getpid
())
self
.
parent
,
context_id
,
os
.
getpid
())
LOG
.
debug
(
'Recovered sys.executable: %r'
,
sys
.
executable
)
LOG
.
debug
(
'Recovered sys.executable: %r'
,
sys
.
executable
)
...
...
mitogen/fakessh.py
View file @
a9387b05
...
@@ -384,7 +384,7 @@ def run(dest, router, args, deadline=None, econtext=None):
...
@@ -384,7 +384,7 @@ def run(dest, router, args, deadline=None, econtext=None):
env
=
os
.
environ
.
copy
()
env
=
os
.
environ
.
copy
()
env
.
update
({
env
.
update
({
'PATH'
:
'%s:%s'
%
(
tmp_path
,
env
.
get
(
'PATH'
,
''
)),
'PATH'
:
'%s:%s'
%
(
tmp_path
,
env
.
get
(
'PATH'
,
''
)),
'ARGV0'
:
`[sys.executable]`
,
'ARGV0'
:
sys
.
executable
,
'SSH_PATH'
:
ssh_path
,
'SSH_PATH'
:
ssh_path
,
})
})
...
...
mitogen/master.py
View file @
a9387b05
...
@@ -588,7 +588,7 @@ class Stream(mitogen.core.Stream):
...
@@ -588,7 +588,7 @@ class Stream(mitogen.core.Stream):
os
.
dup2
(
R
,
0
)
os
.
dup2
(
R
,
0
)
os
.
dup2
(
R2
,
101
)
os
.
dup2
(
R2
,
101
)
for
f
in
R
,
R2
,
W
,
W2
:
os
.
close
(
f
)
for
f
in
R
,
R2
,
W
,
W2
:
os
.
close
(
f
)
os
.
environ
[
'ARGV0'
]
=
`[sys.executable]`
os
.
environ
[
'ARGV0'
]
=
sys
.
executable
os
.
execv
(
sys
.
executable
,[
'mitogen:CONTEXT_NAME'
])
os
.
execv
(
sys
.
executable
,[
'mitogen:CONTEXT_NAME'
])
else
:
else
:
os
.
write
(
1
,
'EC0
\
n
'
)
os
.
write
(
1
,
'EC0
\
n
'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment