10000 numpy.fromfile OSError: first argument must be an open file (Python 3) · Issue #6246 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
numpy.fromfile OSError: first argument must be an open file (Python 3)  #6246
Closed
@cjermain

Description

@cjermain

Using Python 3 and Numpy 1.9.2 there is an issue with numpy.fromfile when called on an existing file object. This code works fine in Python 2.7.

$ fh
<_io.FileIO name=8 mode='rb+'>
$ np.fromfile(fh, dtype=dtype, count=length)
OSError: first argument must be an open file

I've checked fh.closed is False, so the file is still open. The error is thrown by numpy.multiarraymodule.c#2119.

Someone mentioned these issues on Stack Overflow, but no clear solutions are present.

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0