This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zufuliu
Recipients paul.moore, steve.dower, tim.golden, zach.ware, zufuliu
Date 2019-06-28.01:53:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561686823.22.0.469835611791.issue37436@roundup.psfhosted.org>
In-reply-to
Content
I think it's should be TypeError as Python 2.7.

The doc https://docs.python.org/3/library/os.path.html
doesn't says it accept file descriptor.


Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.isfile(123)
False
>>> os.path.isfile(2**32)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Dev\Python3\lib\genericpath.py", line 30, in isfile
    st = os.stat(path)
OverflowError: fd is greater than maximum
>>>

Python 3.8.0b1 (tags/v3.8.0b1:3b5deb0116, Jun  4 2019, 19:52:55) [MSC v.1916 64 bit (AMD64)] on win32
>>> import os.path
>>> os.path.isfile(123)
False
>>> os.path.isfile(2**32)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\obj\Windows-Release\38amd64_Release\msi_python\zip_amd64\genericpath.py", line 30, in isfile
OverflowError: fd is greater than maximum
>>>

Python 2.7.16 (v2.7.16:413a49145e, Mar  4 2019, 01:37:19) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.isfile(123)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Dev\Python\lib\genericpath.py", line 37, in isfile
    st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, int found
>>>
History
Date User Action Args
2019-06-28 01:53:43zufuliusetrecipients: + zufuliu, paul.moore, tim.golden, zach.ware, steve.dower
2019-06-28 01:53:43zufuliusetmessageid: <1561686823.22.0.469835611791.issue37436@roundup.psfhosted.org>
2019-06-28 01:53:43zufuliulinkissue37436 messages
2019-06-28 01:53:42zufuliucreate