[New-bugs-announce] [issue28530] Howto detect if an object is of type os.DirEntry

stephan report at bugs.python.org
Tue Oct 25 11:46:16 EDT 2016


New submission from stephan:

I have a small problem with python 3.5.2 64bit on win7 64 bit:

I cannot check if an object is of type DirEntry 
(os.DirEntry or nt.DirEntry).

Did I misunderstand something or what is wrong?

Here is a log of my console:
-----------------------------------------
In [63]: sd = os.scandir(".")

In [64]: de = next(sd)

In [65]: type(de)
Out[65]: nt.DirEntry

In [66]: import nt

In [67]: nt.DirEntry
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-67-bb02e8263344> in <module>()
----> 1 nt.DirEntry

AttributeError: module 'nt' has no attribute 'DirEntry'

In [68]: os.DirEntry
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-68-5aa7495652fa> in <module>()
----> 1 os.DirEntry

AttributeError: module 'os' has no attribute 'DirEntry'

In [69]:

------------------------------------------

----------
messages: 279415
nosy: stephan
priority: normal
severity: normal
status: open
title: Howto detect if an object is of type os.DirEntry
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28530>
_______________________________________


More information about the New-bugs-announce mailing list