Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: requests.api.get() got multiple values for keyword argument 'auth' (in version 2.8.0) #160

Closed
pesekon2 opened this issue Jul 25, 2024 · 2 comments

Comments

@pesekon2
Copy link
Contributor

Running my code with version 2.8.0 instead of 2.7.0 fails with the following error message. Is there some change I need to do when transferring to the new version?

Traceback (most recent call last):
  File "/opt/scripts/create_layers.py", line 104, in <module>
    main(
  File "/opt/scripts/create_layers.py", line 29, in main
    datastores = geo.get_datastores(workspace=workspace)
  File "/usr/local/lib/python3.10/dist-packages/geo/Geoserver.py", line 478, in get_datastores
    r = self._requests("get", url, auth=(self.username, self.password))
  File "/usr/local/lib/python3.10/dist-packages/geo/Geoserver.py", line 171, in _requests
    return requests.get(url, auth=(self.username, self.password), **kwargs, **self.request_options)
TypeError: requests.api.get() got multiple values for keyword argument 'auth'

This is the code snippet that fails (at the last line). It works when I switch back to 2.7.0 but I would like to use the request_options (commented now).

    geo = Geoserver(
        url, username=username, password=password,
        # request_options={'timeout': timeout}
    )

    # create workspace
    workspaces = geo.get_workspaces()
    if workspace not in workspaces.keys():
        print('create workspace')
        geo.create_workspace(workspace=workspace)

    # create store
    datastores = geo.get_datastores(workspace=workspace)
iamtekson added a commit that referenced this issue Jul 25, 2024
got auth multiple val error #160
@iamtekson
Copy link
Collaborator

Thank you @pesekon2 for reporting this issue. Yes, I just saw this issue in our code block. Please install v2.8.1 to fix this issue.

@pesekon2
Copy link
Contributor Author

@iamtekson: Yes, tested and works now. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants