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 vstinner
Recipients matrixise, mdk, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2019-02-19.15:52:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550591537.65.0.703743627185.issue36021@roundup.psfhosted.org>
In-reply-to
Content
PR 11931 experimented other tests:

         return os.path.isfile(path) and os.access(path, os.X_OK)

and:

        is_exe = False
        with open(path, 'rb') as fp:
            s = fp.read(2)
            is_exe = s != b'MZ'
         return os.path.isfile(path) and is_exe

I'm not sure that it's safe. Windows support a wide range of programs: .COM, .EXE, .VBS, .BAT, etc. It's hard to get a complete list.
History
Date User Action Args
2019-02-19 15:52:17vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, steve.dower, matrixise, mdk
2019-02-19 15:52:17vstinnersetmessageid: <1550591537.65.0.703743627185.issue36021@roundup.psfhosted.org>
2019-02-19 15:52:17vstinnerlinkissue36021 messages
2019-02-19 15:52:17vstinnercreate