Skip to content

dreampi check_internet_connection function doesn't handle socket.timeout? #20

@Docteh

Description

@Docteh

I saw someone on reddit (discussion here) with an interesting issue with getting this to work using a PC image

image

dreampi/dreampi.py

Lines 51 to 57 in 4937c80

for host in IP_ADDRESS_LIST:
try:
socket.setdefaulttimeout(timeout)
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
return True
except socket.error:
pass

with the timeout: timed out message I suspect that socket.timeout exceptions should also be given a pass, particularly if the DNS server being tested not respond to TCP connections on port 53

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions