Skip to content

[Python] Error from file object destructor #16472

@asfimport

Description

@asfimport

Related to ARROW-822

In [1]: paste
import pyarrow as pa
import socket, os, io

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(('127.0.0.1', 0))
server.listen(1)
host, port = server.getsockname()

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', port))

sink = os.fdopen(sock.fileno(), "wb", 65536)
field = pa.Field.from_py("f1", pa.float32())
schema = pa.Schema.from_fields([field])

writer = pa.StreamWriter(sink, schema)
## -- End pasted text --

In [2]: 
Do you really want to exit ([y]/n)? y
close failed in file object destructor:
IOError: [Errno 9] Bad file descriptor

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@scipy.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

Reporter: Wes McKinney / @wesm
Assignee: Wes McKinney / @wesm

Related issues:

Note: This issue was originally created as ARROW-866. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions