Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
054ad56e
Commit
054ad56e
authored
Dec 29, 2013
by
Fantix King
Committed by
Denis Bilenko
Apr 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix str/bytes issue.
* udp_client.py * gevent/subprocess.py
parent
cc1f2425
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
examples/udp_client.py
examples/udp_client.py
+1
-1
gevent/subprocess.py
gevent/subprocess.py
+2
-2
greentest/test__example_udp_client.py
greentest/test__example_udp_client.py
+2
-2
No files found.
examples/udp_client.py
View file @
054ad56e
...
@@ -16,6 +16,6 @@ message = ' '.join(sys.argv[1:])
...
@@ -16,6 +16,6 @@ message = ' '.join(sys.argv[1:])
sock
=
socket
.
socket
(
type
=
socket
.
SOCK_DGRAM
)
sock
=
socket
.
socket
(
type
=
socket
.
SOCK_DGRAM
)
sock
.
connect
(
address
)
sock
.
connect
(
address
)
print
(
'Sending %s bytes to %s:%s'
%
((
len
(
message
),
)
+
address
))
print
(
'Sending %s bytes to %s:%s'
%
((
len
(
message
),
)
+
address
))
sock
.
send
(
message
)
sock
.
send
(
message
.
encode
()
)
data
,
address
=
sock
.
recvfrom
(
8192
)
data
,
address
=
sock
.
recvfrom
(
8192
)
print
(
'%s:%s: got %r'
%
(
address
+
(
data
,
)))
print
(
'%s:%s: got %r'
%
(
address
+
(
data
,
)))
gevent/subprocess.py
View file @
054ad56e
...
@@ -143,13 +143,13 @@ def check_output(*popenargs, **kwargs):
...
@@ -143,13 +143,13 @@ def check_output(*popenargs, **kwargs):
The arguments are the same as for the Popen constructor. Example:
The arguments are the same as for the Popen constructor. Example:
>>> check_output(["ls", "-1", "/dev/null"])
>>> check_output(["ls", "-1", "/dev/null"])
'/dev/null\n'
b
'/dev/null\n'
The stdout argument is not allowed as it is used internally.
The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=STDOUT.
To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c", "echo hello world"], stderr=STDOUT)
>>> check_output(["/bin/sh", "-c", "echo hello world"], stderr=STDOUT)
'hello world\n'
b
'hello world\n'
"""
"""
if
'stdout'
in
kwargs
:
if
'stdout'
in
kwargs
:
raise
ValueError
(
'stdout argument not allowed, it will be overridden.'
)
raise
ValueError
(
'stdout argument not allowed, it will be overridden.'
)
...
...
greentest/test__example_udp_client.py
View file @
054ad56e
...
@@ -12,7 +12,7 @@ class Test_udp_client(TestCase):
...
@@ -12,7 +12,7 @@ class Test_udp_client(TestCase):
def
handle
(
message
,
address
):
def
handle
(
message
,
address
):
log
.
append
(
message
)
log
.
append
(
message
)
server
.
sendto
(
'reply-from-server'
,
address
)
server
.
sendto
(
b
'reply-from-server'
,
address
)
server
=
DatagramServer
(
'127.0.0.1:9000'
,
handle
)
server
=
DatagramServer
(
'127.0.0.1:9000'
,
handle
)
server
.
start
()
server
.
start
()
...
@@ -20,7 +20,7 @@ class Test_udp_client(TestCase):
...
@@ -20,7 +20,7 @@ class Test_udp_client(TestCase):
run
([
sys
.
executable
,
'-u'
,
'udp_client.py'
,
'Test_udp_client'
],
timeout
=
10
,
cwd
=
'../examples/'
)
run
([
sys
.
executable
,
'-u'
,
'udp_client.py'
,
'Test_udp_client'
],
timeout
=
10
,
cwd
=
'../examples/'
)
finally
:
finally
:
server
.
close
()
server
.
close
()
self
.
assertEqual
(
log
,
[
'Test_udp_client'
])
self
.
assertEqual
(
log
,
[
b
'Test_udp_client'
])
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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