[
https://issues.apache.org/jira/browse/ARROW-2036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16340257#comment-16340257
]
ASF GitHub Bot commented on ARROW-2036:
---------------------------------------
wesm commented on a change in pull request #1517: ARROW-2036: [Python] Support
standard IOBase methods on NativeFile
URL: https://github.com/apache/arrow/pull/1517#discussion_r163995819
##########
File path: python/pyarrow/io.pxi
##########
@@ -39,13 +39,14 @@ cdef extern from "Python.h":
cdef class NativeFile:
-
def __cinit__(self):
- self.is_open = False
+ self.closed = True
self.own_file = False
Review comment:
I think this arose due to some wacky GC issues with HDFS file handles, I'd
have to look back at the original commit that added this to remember. My prior
would be that `__dealloc__` / `__del__` should close the file if it is open.
With `MemoryMappedFile`, this is a no-op because the file descriptor is owned
by the mapped buffer, whose lifetime may exceed the file object
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> NativeFile should support standard IOBase methods
> -------------------------------------------------
>
> Key: ARROW-2036
> URL: https://issues.apache.org/jira/browse/ARROW-2036
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Python
> Reporter: Jim Crist
> Priority: Minor
> Labels: pull-request-available
>
> If `NativeFile` supported most/all of the standard IOBase methods
> ([https://docs.python.org/3/library/io.html#io.IOBase),] then it'd be easier
> to use arrow files with other python libraries. Would at least be nice to
> support enough operations to use `io.TextIOWrapper`.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)