Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyrasite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
pyrasite
Commits
d0ccb008
Commit
d0ccb008
authored
Mar 23, 2012
by
Luke Macken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the unicodenazi happy
parent
de4de5a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
pyrasite/ipc.py
pyrasite/ipc.py
+1
-1
tests/test_code_injection.py
tests/test_code_injection.py
+2
-2
tests/test_ipc.py
tests/test_ipc.py
+3
-3
No files found.
pyrasite/ipc.py
View file @
d0ccb008
...
@@ -139,7 +139,7 @@ class PyrasiteIPC(object):
...
@@ -139,7 +139,7 @@ class PyrasiteIPC(object):
"""
"""
Send a python command to exec in the process and return the output
Send a python command to exec in the process and return the output
"""
"""
self
.
send
(
cmd
+
'
\
n
'
)
self
.
send
(
cmd
+
u
'
\
n
'
)
return
self
.
recv
()
return
self
.
recv
()
def
send
(
self
,
data
):
def
send
(
self
,
data
):
...
...
tests/test_code_injection.py
View file @
d0ccb008
...
@@ -158,8 +158,8 @@ class TestCodeInjection(unittest.TestCase):
...
@@ -158,8 +158,8 @@ class TestCodeInjection(unittest.TestCase):
stdout
,
stderr
=
p
.
communicate
()
stdout
,
stderr
=
p
.
communicate
()
count
=
0
count
=
0
for
line
in
stdout
.
decode
(
'utf-8'
).
split
(
'
\
n
'
):
for
line
in
unicode
(
stdout
,
'utf-8'
).
split
(
u
'
\
n
'
):
if
line
.
strip
()
==
'Hello World!'
:
if
line
.
strip
()
==
u
'Hello World!'
:
count
+=
1
count
+=
1
os
.
unlink
(
program
)
os
.
unlink
(
program
)
...
...
tests/test_ipc.py
View file @
d0ccb008
...
@@ -57,13 +57,13 @@ class TestIPC(unittest.TestCase):
...
@@ -57,13 +57,13 @@ class TestIPC(unittest.TestCase):
def
test_cmd
(
self
):
def
test_cmd
(
self
):
self
.
ipc
.
connect
()
self
.
ipc
.
connect
()
assert
self
.
ipc
.
cmd
(
'print("mu")'
)
==
'mu
\
n
'
assert
self
.
ipc
.
cmd
(
u'print("mu")'
)
==
u
'mu
\
n
'
def
test_unreliable
(
self
):
def
test_unreliable
(
self
):
self
.
ipc
.
reliable
=
False
self
.
ipc
.
reliable
=
False
self
.
ipc
.
connect
()
self
.
ipc
.
connect
()
out
=
self
.
ipc
.
cmd
(
'print("mu")'
)
out
=
self
.
ipc
.
cmd
(
u
'print("mu")'
)
assert
out
==
'mu
\
n
'
,
out
assert
out
==
u
'mu
\
n
'
,
out
def
test_repr
(
self
):
def
test_repr
(
self
):
assert
repr
(
self
.
ipc
)
assert
repr
(
self
.
ipc
)
...
...
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