Skip to content

Commit df47974

Browse files
Cyperwuicemac
andauthored
Change 'localhost' to '127.0.0.1' (#305)
Co-authored-by: Michael Howitz <icemac@gmx.net>
1 parent f149c7d commit df47974

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CHANGES.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ Changelog
44
16.1 (unreleased)
55
-----------------
66

7-
- Nothing changed yet.
8-
7+
- Changed "localhost" to "127.0.0.1" to avoid bad hostname resolution
98

109
16.0.1 (2025-09-02)
1110
-------------------

src/pytest_rerunfailures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def _sock_send(self, conn, msg: str):
421421
class ServerStatusDB(SocketDB):
422422
def __init__(self):
423423
super().__init__()
424-
self.sock.bind(("localhost", 0))
424+
self.sock.bind(("127.0.0.1", 0))
425425
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
426426

427427
self.rerunfailures_db = {}
@@ -463,7 +463,7 @@ def _get(self, i: str, k: str) -> int:
463463
class ClientStatusDB(SocketDB):
464464
def __init__(self, sock_port):
465465
super().__init__()
466-
self.sock.connect(("localhost", sock_port))
466+
self.sock.connect(("127.0.0.1", sock_port))
467467

468468
def _set(self, i: str, k: str, v: int):
469469
self._sock_send(self.sock, "|".join(("set", i, k, str(v))))

0 commit comments

Comments
 (0)