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

PanicExecption in python sdk #697

Closed
1 task done
cody-scott opened this issue Apr 8, 2024 · 2 comments · Fixed by #676
Closed
1 task done

PanicExecption in python sdk #697

cody-scott opened this issue Apr 8, 2024 · 2 comments · Fixed by #676
Labels
bug Something isn't working

Comments

@cody-scott
Copy link

Steps To Reproduce

when attempting to create the api twice in the same process, getting an error.

from bitwarden_sdk import BitwardenClient
client = BitwardenClient()

client = BitwardenClient()

raises

File c:\Users\username\Miniconda3\envs\jupyer_11\Lib\site-packages\bitwarden_sdk\bitwarden_client.py:10, in BitwardenClient.__init__(self, settings)
      8 def __init__(self, settings: ClientSettings = None):
      9     if settings is None:
---> 10         self.inner = bitwarden_py.BitwardenClient(None)
     11     else:
     12         settings_json = json.dumps(settings.to_dict())

PanicException: called `Result::unwrap()` on an `Err` value: SetLoggerError(())

Expected Result

Not raise an error, or return a reference to the existing object

Actual Result

Panic error raised.

File c:\Users\username\Miniconda3\envs\jupyer_11\Lib\site-packages\bitwarden_sdk\bitwarden_client.py:10, in BitwardenClient.__init__(self, settings)
      8 def __init__(self, settings: ClientSettings = None):
      9     if settings is None:
---> 10         self.inner = bitwarden_py.BitwardenClient(None)
     11     else:
     12         settings_json = json.dumps(settings.to_dict())

PanicException: called `Result::unwrap()` on an `Err` value: SetLoggerError(())

Screenshots or Videos

No response

Additional Context

Ideally it would either create a new instance of the object, or return a reference to the existing object instead of the panic error.

The (likely) preferred approach should be to create the variable once and pass it around, but ideally i should be able to create a second reference to the object and use it the same as the first, or this would be documented if its not the anticipated behaviour.

I can't run this in a jupyter notebook as well without calling the BW client at the top scope either, otherwise subsequent calls raises the error.

Operating System

Windows

Operating System Version

10

Build Version

0.1.0

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@cody-scott cody-scott added the bug Something isn't working label Apr 8, 2024
@Hinton
Copy link
Member

Hinton commented Apr 9, 2024

Resolved by #676

@djsmith85 djsmith85 linked a pull request Apr 9, 2024 that will close this issue
5 tasks
@mittkkoo
Copy link

Maybe I didn't compile correctly the fix or the fix doesn't help.
This is what I tried:
#676 (comment)
I did cargo build in crates/bws as in the newest state of the main branch and then cargo install --path ., but what next? The lookup plugin still fails with a panic error as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants