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.

Title: Use INVALID_FILE_ATTRIBUTES instead of magic numbers
Type: Stage: resolved
Components: Extension Modules, Windows Versions: Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tim.golden Nosy List: brian.curtin, eckhardt, ggenellina, python-dev, tim.golden
Priority: normal Keywords: patch

Created on 2009-01-10 09:41 by eckhardt, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
python-2.7-fileattrib-magic.0.patch eckhardt, 2009-01-10 14:54 patch
Messages (5)
msg79535 - (view) Author: Ulrich Eckhardt (eckhardt) Date: 2009-01-10 09:41
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.
msg79544 - (view) Author: Ulrich Eckhardt (eckhardt) Date: 2009-01-10 14:54
The patch replaces remaining magic numbers with INVALID_FILE_ATTRIBUTES.
msg79712 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-01-13 01:50
The patch looks fine to me
msg201228 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-25 10:23
New changeset 66398e1307f4 by Tim Golden in branch 'default':
Issue4905: use INVALID_FILE_ATTRIBUTES where appropriate. (Patch by Ulrich Eckhardt)
msg201229 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2013-10-25 10:34
Fixed on tip. Thanks for the issue and the original patch.
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49155
2013-10-25 10:34:56tim.goldensetstatus: open -> closed
resolution: fixed
messages: + msg201229

stage: patch review -> resolved
2013-10-25 10:23:36python-devsetnosy: + python-dev
messages: + msg201228
2013-10-24 14:42:24tim.goldensetversions: + Python 3.4, - Python 3.2
2013-10-24 14:42:13tim.goldensetassignee: tim.golden
2010-09-04 00:33:32pitrousetnosy: + tim.golden, brian.curtin
stage: patch review

components: + Extension Modules, Windows, - Interpreter Core
versions: + Python 3.2, - Python 2.7
2009-01-13 01:50:23ggenellinasetnosy: + ggenellina
messages: + msg79712
2009-01-10 14:54:36eckhardtsetfiles: + python-2.7-fileattrib-magic.0.patch
keywords: + patch
messages: + msg79544
2009-01-10 09:41:54eckhardtcreate