Eryk Sun added the comment:

os.DirEntry exists in 3.6, but the change wasn't backported to 3.5. See issue 
27038. As a workaround, you can scan a non-empty directory to get a reference 
to the DirEntry type, e.g.:

    import os
    import tempfile

    with tempfile.NamedTemporaryFile() as f:
        path = os.path.dirname(f.name)
        DirEntry = type(next(os.scandir(path)))

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28530>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to