[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-09-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Committed now. Hopefully it won't break anything! -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: -Python 2.7 ___ Python tracker

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-09-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset 385c2ec78f16 by Antoine Pitrou in branch '3.2': Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is now http://hg.python.org/cpython/rev/385c2ec78f16 New changeset d72d5c942232 by Antoine Pitrou in branch 'default': Issue #12802: the

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Vlad Riscutia
Vlad Riscutia added the comment: Ah, I see Antoine already attached a patch. I was 3 minutes late :) -- ___ Python tracker ___ ___ Py

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Vlad Riscutia
Vlad Riscutia added the comment: Attached updated patch which extends generrmap.c to allow for easy addition of other error mappings. Also regenerated errmap.h and unittest. -- Added file: http://bugs.python.org/file23054/issue12802_2.diff ___ Pyth

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a new patch. -- Added file: http://bugs.python.org/file23053/winenotdir.patch ___ Python tracker ___ __

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, running vcvarsamd64.bat seems to do the trick. -- ___ Python tracker ___ ___ Python-bugs-list m

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, apparently I can use errmap.mak, except that I get the following error: Z:\default\PC>nmake errmap.mak Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. All rights reserved. cl generrmap.c Micro

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: We could add a special case to generrmap.c (but how can I compile and execute this file? it doesn't seem to be part of the project files). -- ___ Python tracker _

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Vlad Riscutia
Vlad Riscutia added the comment: Oh, got it. Interesting. Then should I just add a comment somewhere or should we resolve this as Won't Fix? -- ___ Python tracker ___ _

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-27 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Unfortunately, it won't work. _dosmaperr() is not exported by msvcrt.dll, it is only available when you link against the static version of the C runtime. -- ___ Python tracker

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Vlad Riscutia
Vlad Riscutia added the comment: I wasn't aware this is an auto-generated file. I can add a comment but looking at it, it seems we auto-generate this file just to save a call to _dosmaperr. I would refactor the whole function to call _dosmaperr first then if result is still EINVAL, tweak with

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: If you have a copy of Visual Studio, you can see the code of _dosmaperr() in VC/crt/src/dosmap.c. Otherwise the Google query "inurl:dosmap.c" returns some online copies of this file. -- ___ Python tracker

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Note that this file is not written by hand. It's generated by PC/generrmap.c, which uses the _dosmaperr() function provided by the msvcrt. If we want to modify it, this should be clearly marked somewhere. --

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Tim Golden
Tim Golden added the comment: Obviously someone's code would break if it were relying on the Unix errno only in a Windows-only situation to determine the situation of opening a directory which isn't one. But that combination of events doesn't seem terribly likely. Speaking for myself, since

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Brian Curtin
Brian Curtin added the comment: With that PEP likely to be accepted, I say go ahead with the change for that benefit. -- ___ Python tracker ___

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I could see how they'd use EINVAL, but to me ENOTDIR makes more sense > here. However, I'm not sure if anyone is depending on this (or what > they could depend on it for). Right now I'm not sure, but if PEP 3151 is accepted it will make much more sense to get

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Brian Curtin
Brian Curtin added the comment: I could see how they'd use EINVAL, but to me ENOTDIR makes more sense here. However, I'm not sure if anyone is depending on this (or what they could depend on it for). -- ___ Python tracker

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Brian, Tim, I'd feel more comfortable if any of you confirmed this isn't a stupid proposal on my part :) -- components: +Interpreter Core stage: needs patch -> patch review ___ Python tracker

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-23 Thread Vlad Riscutia
Vlad Riscutia added the comment: Attached unit test. -- Added file: http://bugs.python.org/file23026/issue12802_unittest.diff ___ Python tracker ___

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: I would add it in test_exceptions, since errno mapping is ultimately used by exceptions. -- ___ Python tracker ___ ___

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-20 Thread Vlad Riscutia
Vlad Riscutia added the comment: Attached new mapping though I don't know where unit test for this should go... -- keywords: +patch nosy: +vladris Added file: http://bugs.python.org/file22969/issue12802.diff ___ Python tracker

[issue12802] Windows error code 267 should be mapped to ENOTDIR, not EINVAL

2011-08-20 Thread Antoine Pitrou
New submission from Antoine Pitrou : Windows error 3 is returned when a directory path doesn't exist, but 267 is returned when an existing path is not a directory. This corresponds straight to the definition of ENOTDIR, but Python translates it to EINVAL: >>> os.listdir("xx") Traceback (most r