[issue37436] os.path.isfile() with big number cause OverflowError: fd is greater than maximum

Zufu Liu report at bugs.python.org
Mon Jul 1 22:49:01 EDT 2019


Zufu Liu <zufuliu at 163.com> added the comment:

Please also consider following pieces of code.
They (value of int sub classes) can't be returned by fileno().

Python 3.8.0b1 (tags/v3.8.0b1:3b5deb0116, Jun  4 2019, 19:52:55) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class MyInt(int):pass
...
>>> a=MyInt(6)
>>> a
6
>>> import os.path
>>> os.path.isfile(a)
False
>>> os.path.isfile(True)
False
>>> os.path.isfile(False)
False
>>>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37436>
_______________________________________


More information about the Python-bugs-list mailing list