Skip to content

URL with hyphen char (-) generates "No host specified" error #612

@lantonioli

Description

@lantonioli

Specifications

  • Client Version: 1.37.0
  • InfluxDB Version: 2.7.1
  • Platform: Alpine Linux 3.1.1 with python version 3.8.10

Code sample to reproduce problem

import influxdb_client

config_host = 'local-server'

with influxdb_client.InfluxDBClient(url=f'{config_host}:8086', username='user', password='password', org='organization') as client:
      write_api = client.write_api(write_options=influxdb_client.client.write_api.SYNCHRONOUS)
      write_api.write('bucket/autogen', json_body, write_precision='ms')

Expected behavior

Write point successful

Actual behavior

write_api.write(...) returns an error "No host specified."

Additional info

If I change influxdb url to 'local.server' all goes fine.
It seems that hyphen character In url string is not supported by the lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions