Skip to content

BUG: HTTP basic authentication fails with "module 'requests' has no attribute 'HTTPBasicAuth'" #221

@robertof-surveypal

Description

@robertof-surveypal

Describe the bug
When making a call to an instance of export server protected with HTTP basic authentication the code fails as in

basic_auth = requests.HTTPBasicAuth(auth_user, auth_password)
it tries to access HTTPBasicAuth from requests. The class is exported by requests.auth, as documented at: https://requests.readthedocs.io/en/latest/user/authentication/#basic-authentication

To Reproduce
Steps to reproduce the behavior:

  1. When I attempt to export a chart using the following code:
chart.download_chart(
    format="svg",
    timeout=30,
    auth_user="a username",
    auth_password="a password",
)
  1. I receive this error: AttributeError: module 'requests' has no attribute 'HTTPBasicAuth'

Expected behavior
The chart is downloaded and available to the calling code.

Your Environment:

  • OS: MacOS
  • Python Version: 3.12
  • Highcharts JavaScript Version: not relevant, the javascript code is not invoked at all

Additional context:
Tested with highcharts-core 1.10.3 and requests 2.32.4

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions