[python-sybase] RE: 64-bit python sybase module failure SOLVED

Andrew McNamara andrewm at object-craft.com.au
Wed Nov 9 09:28:16 EST 2005


>I realize that my problem is because 64-bit sybase libraries are not
>accomodated in the setup.py file for the 64-bit python. Hence here's a
>patch to make it select the right libs. 

Thanks! Do you know if this is likely to be true of all linux
distributions (i.e., are the files installed by sybase or the
distribution)?

>(I've never written in python. I am a sysadmin. 

I hope it won't be your last venture into Python - it's an excellent
language for system administration.

>I was looking for some internal python variable that would return the bit
>arch, but all I could come up with was a 'uname' command. Not ideal but I
>do use a bedrock command that all linux os should have.)

I think the os.uname() function is the one you're looking for. Can you fire
up the Python interactive mode and show us the output on your system? Eg:

 $ python
 Python 2.3.5 (#2, Aug 30 2005, 15:50:26)
 [GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> os.uname()
 ('Linux', 'longblack', '2.6.14', '#1 SMP Mon Oct 31 19:45:30 EST 2005', 'i686')

>
>--- sybase-0.37/setup.py        2005-04-06 18:46:43.000000000 -0400
>+++ sybase-0.37.patch/setup.py  2005-11-08 10:44:26.840499000 -0500
>@@ -45,7 +45,12 @@
>     # On Linux the Sybase tcl library is distributed as sybtcl
>     syb_libs = []
>     if os.uname()[0] == 'Linux':
>-        lib_names = ['blk', 'ct', 'cs', 'sybtcl', 'insck', 'comn',
>'intl']
>+        # accomodate 64-bit sybase libraries
>+        arch = os.popen("uname -m").read().splitlines()[0]
>+       if "x86_64" == arch:
>+          lib_names = ['blk64', 'ct64', 'cs64', 'sybtcl64', 'insck64',
>'comn64', 'intl64']
>+       else:
>+           lib_names = ['blk', 'ct', 'cs', 'sybtcl', 'insck', 'comn', 
>+ 'intl']
>     elif os.uname()[0] == 'AIX':
>         lib_names = ['blk', 'ct', 'cs', 'comn', 'tcl', 'intl', 'insck']
>     else:
-- 
Andrew McNamara, Senior Developer, Object Craft
http://www.object-craft.com.au/


More information about the Python-sybase mailing list