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

Support named temporary files context manager. #47

Open
kyleabeauchamp opened this issue Oct 1, 2017 · 2 comments
Open

Support named temporary files context manager. #47

kyleabeauchamp opened this issue Oct 1, 2017 · 2 comments

Comments

@kyleabeauchamp
Copy link
Contributor

Some python functions require a physical file and are not satisfied by the mocked interface provided by OBSFile().open(). In such situations, a nice idiom might be to create a named temporary file with a context manager that deletes upon context exit; stor could facilitate this by a member function on the Path object.

@kyleabeauchamp
Copy link
Contributor Author

kyleabeauchamp commented Oct 1, 2017

In particular, this is the error raised when some low-level functions attempt to use an OBSFile:

AttributeError: 'OBSFile' object has no attribute 'fileno'

@jtratner
Copy link
Contributor

jtratner commented Oct 2, 2017

what would you imagine the API would look like for this?

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

No branches or pull requests

2 participants