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

MontyClient instanciation fails #74

Closed
ramnes opened this issue Feb 2, 2023 · 3 comments
Closed

MontyClient instanciation fails #74

ramnes opened this issue Feb 2, 2023 · 3 comments

Comments

@ramnes
Copy link

ramnes commented Feb 2, 2023

Hey @davidlatwe, thanks for the great library!

There may be something wrong with MontyClient() called without any argument, as it fails when a .monty.storage file already exists.

Take such a file:

import montydb

montydb.MontyClient()

Run it twice and you should get this:

$ python issue.py
$ # no error yet
$ python issue.py
Traceback (most recent call last):
  File "issue.py", line 3, in <module>
    montydb.MontyClient()
  File ".venv/lib/python3.9/site-packages/montydb/client.py", line 50, in __init__
    self.__options = ClientOptions(options, wconcern)
  File ".venv/lib/python3.9/site-packages/montydb/base.py", line 205, in __init__
    self.__codec_options = bson.parse_codec_options(options)
TypeError: 'NoneType' object is not callable

If this is "normal", maybe an explicit error would make sense here. :)

For the context, Mongo-Thingy is an ODM that supports Monty as a backend. One of our users tried to use Monty and got stuck with this issue: Refty/mongo-thingy#48

@davidlatwe davidlatwe mentioned this issue Feb 2, 2023
@davidlatwe
Copy link
Owner

Hi @ramnes , thanks for the kind words :)

Yes, that indeed is a bug. I've added a test case for it and should be fixed now.
Could you have a test with the current master branch and confirm the issue has been resolved?

Thanks :)

@ramnes
Copy link
Author

ramnes commented Feb 2, 2023

yep, that works :)

@davidlatwe
Copy link
Owner

Thanks! Will make a release shortly, before the end of this week. 🍻

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