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

[Bug]: monty's zopen expects keyword mode to be set #1024

Closed
2 of 3 tasks
FabiPi3 opened this issue Jan 17, 2025 · 3 comments · Fixed by #1025
Closed
2 of 3 tasks

[Bug]: monty's zopen expects keyword mode to be set #1024

FabiPi3 opened this issue Jan 17, 2025 · 3 comments · Fixed by #1025
Labels

Comments

@FabiPi3
Copy link

FabiPi3 commented Jan 17, 2025

Code snippet

with zopen(path, "w", encoding=encoding) as f:
    # do something

To be more precise, its not about passing something as mode, but it should contain "t" or "b".

What happened?

I am using maggma, with a new monty version I get this warning.

Version

0.71.1

Which OS?

  • MacOS
  • Windows
  • Linux

Log output

/path/to/python/lib/python3.12/site-packages/maggma/stores/mongolike.py:687: FutureWarning: We strongly discourage using implicit binary/text 
`mode`, and this would not be allowed after 2025-06-01. I.e. you should pass t/b in `mode`.
@FabiPi3 FabiPi3 added the bug label Jan 17, 2025
@rkingsbury
Copy link
Collaborator

Hi @FabiPi3 , thanks for reporting. This has already been fixed in #1021 . Please update your maggma install and the warning should go away (but if it doesn't , please reopen).

@rkingsbury
Copy link
Collaborator

Edit: actually I see that you are already on the latest version. It appears the monty warning has changed (it previously instructed to set mode='r'). I will try to update maggma soon to use t instead, or feel free to open a PR if you're able.

@FabiPi3
Copy link
Author

FabiPi3 commented Jan 17, 2025

Actually if I understand correctly, mode="rt" would be the best.

BTW it also applies for lines 714 and 764.

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

Successfully merging a pull request may close this issue.

2 participants