[Python] Warning and ConnectionRefusedError when using hrequests package on Linux

Discussão em 'Python' iniciado por Stack, Dezembro 8, 2024.

  1. Stack

    Stack Membro Participativo

    I'm encountering issues while using the hrequests package on my Linux server. When importing the package, I frequently receive the following warning:

    HTTP server ListenAndServe: listen tcp: lookup tcp/@…�Ñd: unknown port


    The characters after tcp/ change with each occurrence. This warning doesn't appear every time I import the package, but it's quite frequent.

    When this warning appears, I know my hrequests code will later throw an error:

    ConnectionRefusedError: [Errno 111] Connection refused


    I've attempted to isolate the issue by using a Docker container, but the error persists. My Dockerfile starts with:

    FROM ubuntu:24.04


    Then I install Python 3.11 and hrequests.

    Interestingly, everything works fine on my local Windows machine running Python 3.11, with no errors occurring.

    I would greatly appreciate if someone could provide a Docker setup where hrequests works correctly.

    Continue reading...

Compartilhe esta Página