mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Merge pull request #4529 from haxelion/bugfix/fix_gethostbyname_ex
Ensure socket.gethostbyname_ex only returns IPv4 addresses
This commit is contained in:
2 files changed
+1
-3
No files matched your search
Vendored
-2
@@ -782,8 +782,6 @@ class HandlerTests(unittest.TestCase):
|
||||
self.assertEqual(headers.get("Content-type"), mimetype)
|
||||
self.assertEqual(int(headers["Content-length"]), len(data))
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
def test_file(self):
|
||||
import email.utils
|
||||
h = urllib.request.FileHandler()
|
||||
|
||||
@@ -1835,7 +1835,7 @@ mod _socket {
|
||||
name: PyStrRef,
|
||||
vm: &VirtualMachine,
|
||||
) -> Result<(String, PyListRef, PyListRef), IoOrPyException> {
|
||||
let addr = get_addr(vm, name, c::AF_UNSPEC)?;
|
||||
let addr = get_addr(vm, name, c::AF_INET)?;
|
||||
let (hostname, _) = dns_lookup::getnameinfo(&addr, 0)
|
||||
.map_err(|e| convert_socket_error(vm, e, SocketError::HError))?;
|
||||
Ok((
|
||||
|
||||
Reference in new issue
Block a user