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 Jeffrey.Armstrong
Recipients Jeffrey.Armstrong
Date 2015-04-06.12:41:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428324075.5.0.672514551353.issue23876@psf.upfronthosting.co.za>
In-reply-to
Content
Within Modules/posixmodule.c:4914 (in 3.5.0a3), the preprocessor checks for compiler macros as such:

#if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__QNX__)
        result = mkdir(path->narrow);
#else
        result = mkdir(path->narrow, mode);
#endif

The purpose of the code was to detect if we're compiling using Watcom, but not on QNX, or VisualAge as our compiler, where mkdir() wouldn't accept a mode.  However, Watcom supports Linux as well and properly implements the mode argument, causing the compilation to fail.

The proper check, rather than looking for "!defined(__QNX__)" would be "!defined(__UNIX__)," which would allow the code to properly compile using Watcom on either Linux or QNX:

#if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__UNIX__)
        result = mkdir(path->narrow);
#else
        result = mkdir(path->narrow, mode);
#endif


FYI, in Watcom, the __UNIX__ macro is defined on both Linux and QNX, so this change will not break code for people who are still using Watcom to build Python for QNX (which is probably nobody at all).

There are two other places where the __QNX__ macro should be replaced in Modules/posixmodule.c, and the attached patch fixes both.
History
Date User Action Args
2015-04-06 12:41:15Jeffrey.Armstrongsetrecipients: + Jeffrey.Armstrong
2015-04-06 12:41:15Jeffrey.Armstrongsetmessageid: <1428324075.5.0.672514551353.issue23876@psf.upfronthosting.co.za>
2015-04-06 12:41:15Jeffrey.Armstronglinkissue23876 messages
2015-04-06 12:41:15Jeffrey.Armstrongcreate