[Python-Dev] struct.pack() on 64bit machine (original) (raw)

Aleksander Piotrowski aleksander.piotrowski at nic.com.pl
Sat Mar 20 10:40:44 EST 2004


Hi

I'm running python on OpenBSD/sparc64 (SUN Ultra 10) and have question about struct module.

On this machine struct.pack() gives me:

struct.pack('l', 1) '\x00\x00\x00\x00\x00\x00\x00\x01' struct.pack('i', 1) '\x00\x00\x00\x01'

On i386 box I have:

struct.pack('l', 1) '\x01\x00\x00\x00' struct.pack('i', 1) '\x01\x00\x00\x00'

Because of this, OpenBSD port have following patch: OpenBSD:patch−Libtesttestfcntlpy,v1.1.1.12003/12/3117:38:33sturmExpOpenBSD: patch-Lib_test_test_fcntl_py,v 1.1.1.1 2003/12/31 17:38:33 sturm Exp OpenBSD:patchLibtesttestfcntlpy,v1.1.1.12003/12/3117:38:33sturmExp --- Lib/test/test_fcntl.py.orig 2003-12-31 12:13:00.000000000 +0100 +++ Lib/test/test_fcntl.py 2003-12-31 12:14:14.000000000 +0100 @@ -22,9 +22,13 @@ if sys.platform.startswith('atheos'):

if sys.platform in ('netbsd1', 'Darwin1.2', 'darwin', 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',

elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']: lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) elif sys.platform in ['os2emx']:

Is it OK? It should work like this on 64bit machine, right?

Thanks,

Alek



More information about the Python-Dev mailing list