[Python-Dev] FW: Fixing os.popen on Win32 => is the win32pipe stuff going to be adopted?

M.-A. Lemburg mal@lemburg.com
Thu, 09 Mar 2000 15:42:37 +0100


Trent Mick wrote:
> 
> MAL:
> >     architecture(executable='/usr/local/bin/python', bits='',
> > linkage='') :
> >
> >         Values that cannot be determined are returned as given by the
> >         parameter presets. If bits is given as '', the sizeof(long) is
> >         used as indicator for the supported pointer size.
> 
> Just a heads up, using sizeof(long) will not work on forthcoming WIN64
> (LLP64 data model) to determine the supported pointer size. You would want
> to use the 'P' struct format specifier instead, I think (I am speaking in
> relative ignorance). However, the docs say that a PyInt is used to store 'P'
> specified value, which as a C long, will not hold a pointer on LLP64. Hmmmm.
> The keyword perhaps is "forthcoming".
> 
> This is the code in question in platform.py:
> 
>     # Use the sizeof(long) as default number of bits if nothing
>     # else is given as default.
>     if not bits:
>         import struct
>         bits = str(struct.calcsize('l')*8) + 'bit'

Python < 1.5.2 doesn't support 'P', but anyway, I'll change
those lines according to your suggestion.
 
Does struct.calcsize('P')*8 return 64 on 64bit-platforms as
it should (probably ;) ?

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/