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
36451f07
Commit
36451f07
authored
Jun 10, 2013
by
Ronald Oussoren
Browse files
Options
Browse Files
Download
Plain Diff
(3.3->default) Ensure that the fix for #17269 also works on OSX 10.4
AI_NUMERICSERV isn't defined on OSX 10.4.
parents
531381f2
a822d366
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
Lib/test/test_socket.py
Lib/test/test_socket.py
+2
-1
Modules/socketmodule.c
Modules/socketmodule.c
+1
-1
No files found.
Lib/test/test_socket.py
View file @
36451f07
...
...
@@ -1202,7 +1202,8 @@ class GeneralModuleTests(unittest.TestCase):
self
.
assertRaises
(
UnicodeEncodeError
,
socket
.
getaddrinfo
,
'localhost'
,
'
\
uD800
'
)
# Issue 17269
socket
.
getaddrinfo
(
"localhost"
,
None
,
0
,
0
,
0
,
socket
.
AI_NUMERICSERV
)
if
hasattr
(
socket
,
'AI_NUMERICSERV'
):
socket
.
getaddrinfo
(
"localhost"
,
None
,
0
,
0
,
0
,
socket
.
AI_NUMERICSERV
)
def
test_getnameinfo
(
self
):
# only IP addresses are allowed
...
...
Modules/socketmodule.c
View file @
36451f07
...
...
@@ -4975,7 +4975,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
PyErr_SetString
(
PyExc_OSError
,
"Int or String expected"
);
goto
err
;
}
#if
def __APPLE__
#if
defined(__APPLE__) && defined(AI_NUMERICSERV)
if
((
flags
&
AI_NUMERICSERV
)
&&
(
pptr
==
NULL
||
(
pptr
[
0
]
==
'0'
&&
pptr
[
1
]
==
0
)))
{
/* On OSX upto at least OSX 10.8 getaddrinfo crashes
* if AI_NUMERICSERV is set and the servname is NULL or "0".
...
...
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