Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cbb0ae4a
Commit
cbb0ae4a
authored
Jul 28, 2010
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa.
parent
8182b717
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
Lib/asyncore.py
Lib/asyncore.py
+8
-0
Lib/test/test_asyncore.py
Lib/test/test_asyncore.py
+13
-0
Misc/ACKS
Misc/ACKS
+1
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/asyncore.py
View file @
cbb0ae4a
...
@@ -607,6 +607,14 @@ if os.name == 'posix':
...
@@ -607,6 +607,14 @@ if os.name == 'posix':
def
send
(
self
,
*
args
):
def
send
(
self
,
*
args
):
return
os
.
write
(
self
.
fd
,
*
args
)
return
os
.
write
(
self
.
fd
,
*
args
)
def
getsockopt
(
self
,
level
,
optname
,
buflen
=
None
):
if
(
level
==
socket
.
SOL_SOCKET
and
optname
==
socket
.
SO_ERROR
and
not
buflen
):
return
0
raise
NotImplementedError
(
"Only asyncore specific behaviour "
"implemented."
)
read
=
recv
read
=
recv
write
=
send
write
=
send
...
...
Lib/test/test_asyncore.py
View file @
cbb0ae4a
...
@@ -428,6 +428,19 @@ class FileWrapperTest(unittest.TestCase):
...
@@ -428,6 +428,19 @@ class FileWrapperTest(unittest.TestCase):
w
.
close
()
w
.
close
()
self
.
assertEqual
(
open
(
TESTFN
,
'rb'
).
read
(),
self
.
d
+
d1
+
d2
)
self
.
assertEqual
(
open
(
TESTFN
,
'rb'
).
read
(),
self
.
d
+
d1
+
d2
)
@
unittest
.
skipUnless
(
hasattr
(
asyncore
,
'file_dispatcher'
),
'asyncore.file_dispatcher required'
)
def
test_dispatcher
(
self
):
fd
=
os
.
open
(
TESTFN
,
os
.
O_RDONLY
)
data
=
[]
class
FileDispatcher
(
asyncore
.
file_dispatcher
):
def
handle_read
(
self
):
data
.
append
(
self
.
recv
(
29
))
s
=
FileDispatcher
(
fd
)
os
.
close
(
fd
)
asyncore
.
loop
(
timeout
=
0.01
,
use_poll
=
True
,
count
=
2
)
self
.
assertEqual
(
b""
.
join
(
data
),
self
.
d
)
class
BaseTestHandler
(
asyncore
.
dispatcher
):
class
BaseTestHandler
(
asyncore
.
dispatcher
):
...
...
Misc/ACKS
View file @
cbb0ae4a
...
@@ -448,8 +448,8 @@ Andrew Kuchling
...
@@ -448,8 +448,8 @@ Andrew Kuchling
Vladimir Kushnir
Vladimir Kushnir
Cameron Laird
Cameron Laird
Torsten Landschoff
Torsten Landschoff
Tino Lange
Łukasz Langa
Łukasz Langa
Tino Lange
Andrew Langmead
Andrew Langmead
Detlef Lannert
Detlef Lannert
Soren Larsen
Soren Larsen
...
...
Misc/NEWS
View file @
cbb0ae4a
...
@@ -475,6 +475,8 @@ C-API
...
@@ -475,6 +475,8 @@ C-API
Library
Library
-------
-------
- Issue #9354: Provide getsockopt() in asyncore's file_wrapper.
- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
- Issue #8966: ctypes: Remove implicit bytes-unicode conversion.
- Issue #9378: python -m pickle <pickle file> will now load and
- Issue #9378: python -m pickle <pickle file> will now load and
...
...
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