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

File not closed when verify_header fails #12

Open
philmayes opened this issue Nov 28, 2017 · 0 comments
Open

File not closed when verify_header fails #12

philmayes opened this issue Nov 28, 2017 · 0 comments

Comments

@philmayes
Copy link

I need to convert dbhash because it's not supported in python3, so in python2 I:

  • try to open as semidb
  • if fail, open as dbhash, copy keys to new-name, close, rename.

This lets the conversion happen automagically in my db code, rather than needing explicit conversion. BUT the rename fails because the file has not been closed, so in mmapload.py I made the change:

        try:    # Phil added try...except
            header = f.read(8)
            self._verify_header(header)
        except:
            f.close()
            raise

I did not try to submit a change because it may be better wrapped in the other try clause.

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

1 participant