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
c3a51ecb
Commit
c3a51ecb
authored
Jan 04, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #10819: SocketIO.name property returns -1 when its closed, instead of
raising a ValueError, to fix repr().
parent
8848c7a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
Lib/socket.py
Lib/socket.py
+4
-1
Lib/test/test_socket.py
Lib/test/test_socket.py
+6
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/socket.py
View file @
c3a51ecb
...
...
@@ -307,7 +307,10 @@ class SocketIO(io.RawIOBase):
@
property
def
name
(
self
):
return
self
.
fileno
()
if
not
self
.
closed
:
return
self
.
fileno
()
else
:
return
-
1
@
property
def
mode
(
self
):
...
...
Lib/test/test_socket.py
View file @
c3a51ecb
...
...
@@ -738,6 +738,12 @@ class GeneralModuleTests(unittest.TestCase):
f
=
None
support
.
gc_collect
()
def
test_name_closed_socketio
(
self
):
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
as
sock
:
fp
=
sock
.
makefile
(
"rb"
)
fp
.
close
()
self
.
assertEqual
(
repr
(
fp
),
"<_io.BufferedReader name=-1>"
)
@
unittest
.
skipUnless
(
thread
,
'Threading required for this test.'
)
class
BasicTCPTest
(
SocketConnectedTest
):
...
...
Misc/NEWS
View file @
c3a51ecb
...
...
@@ -30,6 +30,9 @@ Core and Builtins
Library
-------
- Issue #10819: SocketIO.name property returns -1 when its closed, instead of
raising a ValueError, to fix repr().
- Issue #8650: zlib.compress() and zlib.decompress() raise an OverflowError if
the input buffer length doesn't fit into an unsigned int (length bigger than
2^32-1 bytes).
...
...
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