[New-bugs-announce] [issue10888] os.stat(filepath).st_mode gives wrong 'executable permission' result

dobbelaj report at bugs.python.org
Tue Jan 11 14:13:01 CET 2011

New submission from dobbelaj <jeroen.dobbelaere at gmail.com>:

The 'os.stat' method on windows seems to be hardcoded to check the file name extension when computing the 'executable permission flag' (st_mode).

(See Modules/posixmodule.c:  win32_stat and win32_wstat)

Currently, it checks for : 
 '.bat', '.cmd', '.exe', '.com'

As dynamic libraries also must be executable on window, t should also check for : 

It would be even better if the actual 'read and execute' permission is returned.

components: Windows
messages: 126004
nosy: jeroen.dobbelaere
priority: normal
severity: normal
status: open
title: os.stat(filepath).st_mode gives wrong 'executable permission' result
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list