mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Ensure socket.gethostbyname_ex only returns IPv4 addresses
This commit is contained in:
2
Lib/test/test_urllib2.py
vendored
2
Lib/test/test_urllib2.py
vendored
@@ -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