Change exception raised from fileno() (and others) to io.UnsupportedOperation #2276
Comments
@metasyn most likely to get better errors, but at close evaluation it looks a bit like its a bad idea for code thatd does checks - i wonder if there are other users that work that way i checked |
Indeed:
(Same for 2.6) I guess to follow suit we should raise |
Yup |
For compat we should check/ensure its a valueerror subclass |
According to the docs:
So we are all set. |
I'd like to work on this! From what I understood by going through the above discussion is: I need to change the type of exception in |
yup, in case of trouble on python2.6 we will assist |
Sorry slow response here - thanks for your thoughts ya'll. Sounds like a simple change. |
there is no PR so far, so just make one ^^ |
@nicoddemus I summited an initial PR for this but realized you suggested in the title rename "(and others)" - could you let me know what you meant (or what I'm missing?) Thanks! |
Hey thanks for the PR! I was thinking about the other methods in that class which raise exceptions, specially |
A quick look seems like the current behavior of
Not sure if we should change |
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:
https://docs.python.org/2/library/stdtypes.html
Is there a particular reason it is provided?
The text was updated successfully, but these errors were encountered: