Skip to content

Conversation

@jcrist
Copy link
Contributor

@jcrist jcrist commented Jan 24, 2018

Previously checking if the file was closed was subclass specific, and wasn't caught in the hdfs backed file, leading to program crashes.

This adds a check in NativeFile.tell for the file being open, and a test on a few subclasses of NativeFile to assure the error is raised.

Note that since most python file-like objects raise a ValueError for operations after close, I changed the type of the existing error for these cases. This could be changed back, but an error should at least be thrown.

Previously this was subclass specific, and wasn't caught in the hdfs
backed file, leading to program crashes.

Adds a check in `NativeFile.tell` for the file being open, and a test on
a few subclasses of `NativeFile` to assure the error is raised.
Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thanks @jcrist!

@wesm wesm closed this in 68b119b Jan 25, 2018
@jcrist jcrist deleted the hdfs-tell-on-closed branch January 25, 2018 16:42
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

Successfully merging this pull request may close these issues.

2 participants