From owner-freebsd-python@FreeBSD.ORG Thu Jan 26 05:15:40 2012 Return-Path: Delivered-To: python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 506BC1065677; Thu, 26 Jan 2012 05:15:40 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 635E48FC0C; Thu, 26 Jan 2012 05:15:38 +0000 (UTC) Received: by lahj13 with SMTP id j13so143899lah.13 for ; Wed, 25 Jan 2012 21:15:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=c/3A3fGkzLCoJFC8ZPh3Ww2JU6l2K3iL/xKY/0QnBg0=; b=qsgP4mAWdMz9T6bnMEhgGP1DgfC0l8jNqogLOHW7K5BiFKzCCsnbJA2dGxaiYoyOJ4 RzbJwo+23abo1I+gXD7PMD6Yd/BG1G2fylT11FVckQpLxlPp762wLcitoL8J0E2gfp22 ldd216pqn9Ga3It5AQYF2UY92xhZ6yZwIA5Zs= Received: by 10.112.48.65 with SMTP id j1mr115128lbn.76.1327553291231; Wed, 25 Jan 2012 20:48:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.25.196 with HTTP; Wed, 25 Jan 2012 20:47:41 -0800 (PST) In-Reply-To: <4F206B5D.3080302@FreeBSD.org> References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org> From: Eitan Adler Date: Wed, 25 Jan 2012 23:47:41 -0500 Message-ID: To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-standards@freebsd.org, David Schultz , David Chisnall , python@freebsd.org, gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 05:15:40 -0000 On Wed, Jan 25, 2012 at 3:51 PM, Andriy Gapon wrote: > on 25/01/2012 15:23 David Chisnall said the following: >> On 22 Jan 2012, at 19:25, David Schultz wrote: >>> Technically it's a problem with python. =C2=A0If you ask for a strict >>> POSIX environment (doesn't matter what version) and also #include >>> a non-POSIX header, there's no guarantee about what you'll get. >>> I've CC'd the xlocale author in case he wants to comment or >>> voluntarily make xlocale work in an otherwise strict POSIX >>> environment, but that's not officially supported. >> >> The problem is really with glibc, which uses these macros in the opposit= e way to everyone else (glibc thinks defining these macros means expose fun= ctionality from this standard, don't expose it otherwise, everyone else thi= nks they mean expose only the things defined by this standard). =C2=A0This = makes writing portable code a pain and, while I'd usually be keen to blame = Python for everything, in this case I sympathise with their problem. > > Thank you for the insights. > >> Would defining locale_t and the related functions in xlocale.h if we are= in a mode where they are not normally exposed fix the problem? > > I think that this should work. What about patching python to only define the POSIX macros iff glibc is being used (and getting this upstreamed) ? --=20 Eitan Adler