Skip to content

async client raises IPv4 or IPv6 address ValueError for URL "https://eodhistoricaldata.com" #2166

@topher-lo

Description

@topher-lo

Current Behaviour

OS platform

  • WSL Ubuntu 20.04

Python version

  • Python 3.9

Dependencies

  • Just httpx and asyncio
import asyncio
import httpx

async def get():
  r = await httpx.get("https://eodhistoricaldata.com")
  print(r)

asyncio.run(get())

Causes the following error:

Traceback (most recent call last):
  File "/home/USER/miniconda3/envs/project/lib/python3.9/site-packages/anyio/_core/_sockets.py", line 149, in connect_tcp
    addr_obj = ip_address(remote_host)
  File "/home/USER/miniconda3/envs/project/lib/python3.9/ipaddress.py", line 53, in ip_address
    raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
ValueError: 'eodhistoricaldata.com' does not appear to be an IPv4 or IPv6 address

However using the synchronous client does not raise any error:

>>> import requests
>>> requests.get("https://eodhistoricaldata.com")
<Response [200]>

Expected Behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions