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

Warning is triggered even with use_index=False #52

Closed
hguturu opened this issue Aug 11, 2021 · 4 comments
Closed

Warning is triggered even with use_index=False #52

hguturu opened this issue Aug 11, 2021 · 4 comments

Comments

@hguturu
Copy link

hguturu commented Aug 11, 2021

warnings.warn('Could not check mode on {}. Specify `use_index` explicitly to avoid errors.'.format(source))

Is there a way to avoid this warning? I am passing a seekable, non-binary file handle and use_index=False. Specifically a smart_open.open object. It doesn't have a mode attribute when opening s3 objects. It works, just was wondering if I can suppress the warning since the warning doesn't seem to match the issue.

@mobiusklein
Copy link
Contributor

You shouldn't need to worry in your case. This is situation probably needs to be fixed with an unset value to handle default behavior more precisely.

@levitsky
Copy link
Owner

Thanks for reporting. This checking logic is taking me a lot of attempts to get right.
Does the current master behave as expected?

@hguturu
Copy link
Author

hguturu commented Aug 11, 2021

I was triggering this error on 4.4.2.

Using a master, it looks like the warning is suppressed for use_index=False, shows warning for use_index=None, and it errors out with use_index=True, where it tried to load an IndexedFASTA and I have a regular FASTA. I believe this how it should work?

@levitsky
Copy link
Owner

I think so! 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

3 participants