Skip to content

Change exception raised from fileno() (and others) to io.UnsupportedOperation #2276

Closed
@metasyn

Description

@metasyn

In capture, we define a method fileno for the DontReadFromInput:
https://github.com/pytest-dev/pytest/blob/master/_pytest/capture.py#L450

However, python docs suggest this shouldn't be implemented:

file.fileno()

Return the integer “file descriptor” that is used by the underlying implementation to request I/O operations from the operating system. This can be useful for other, lower level interfaces that use file descriptors, such as the fcntl module or os.read() and friends.

Note File-like objects which do not have a real file descriptor should not provide this method!

https://docs.python.org/2/library/stdtypes.html

Is there a particular reason it is provided?

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueeasy issue that is friendly to new contributortype: enhancementnew feature or API change, should be merged into features branchtype: feature-branchnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions