[New-bugs-announce] [issue4905] Use INVALID_FILE_ATTRIBUTES instead of magic numbers

Ulrich Eckhardt report at bugs.python.org
Sat Jan 10 10:41:55 CET 2009

New submission from Ulrich Eckhardt <eckhardt at satorlaser.com>:

GetFileAttributes[W|A] returns a DWORD with this value when it 
couldn't determine the file's attributes. In the Python codebase, 
there are basically three values this is compared with, the above 
macro, 0xffffffff and (DWORD)-1, it should only be the macro.

However, this macro isn't defined in some SDKs (I don't remember if 
those were early MSVC versions or some MS Windows CE SDKs), so we also 
need to work around that.

I'm currently preparing a patch that resolves those including the 
workaround when the macro isn't defined.

components: Interpreter Core
messages: 79535
nosy: eckhardt
severity: normal
status: open
title: Use INVALID_FILE_ATTRIBUTES instead of magic numbers
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list