From ytu888 at hotmail.com Mon Oct 1 09:35:33 2007 From: ytu888 at hotmail.com (Y Tu) Date: Mon Oct 1 15:35:46 2007 Subject: [egenix-users] Message-ID: Hi, I'm a newbie for the Python and wanna install Biopython on my new MacBook Pro (intel chip). As a requirement of BioPytbon, I downloaded and installed mxtext tool. However, I got the following error message. Could someone help me to fix the problem? Thank you very much. tuComputer:/applications/Python_Bio/egenix-mx-base-3.0.0.macosx-10.3-fat-py2.5_ucs4.prebuilt lizhexu$ sudo python setup.py install Password: running install running build running mx_autoconf gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -D_GNU_SOURCE=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.5/include -c _configtest.c -o _configtest.o gcc _configtest.o -L/usr/local/lib -L/Library/Frameworks/Python.framework/Versions/2.5/lib -o _configtest success! removing: _configtest.c _configtest.o _configtest gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -D_GNU_SOURCE=1 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.5/include -c _configtest.c -o _configtest.o success! removing: _configtest.c _configtest.o macros to define: [('HAVE_STRPTIME', '1')] macros to undefine: [] running build_ext building extension "mx.DateTime.mxDateTime.mxDateTime" (required) building 'mx.DateTime.mxDateTime.mxDateTime' extension gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -DUSE_FAST_GETCURRENTTIME -DHAVE_STRPTIME=1 -Imx/DateTime/mxDateTime -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.5/include -c mx/DateTime/mxDateTime/mxDateTime.c -o build/temp.macosx-10.3-fat-2.5_ucs2/mx-DateTime-mxDateTime-mxDateTime/mx/DateTime/mxDateTime/mxDateTime.o powerpc-apple-darwin8-gcc-4.0.1: mx/DateTime/mxDateTime/mxDateTime.c: No such file or directory powerpc-apple-darwin8-gcc-4.0.1: no input files i686-apple-darwin8-gcc-4.0.1: mx/DateTime/mxDateTime/mxDateTime.c: No such file or directory i686-apple-darwin8-gcc-4.0.1: no input files lipo: can't figure out the architecture type of: /var/tmp//cc8ljxda.out error: command 'gcc' failed with exit status 1 _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20071001/d399c2cf/attachment.htm From charlie at egenix.com Mon Oct 1 16:39:17 2007 From: charlie at egenix.com (Charlie Clark) Date: Mon Oct 1 15:39:28 2007 Subject: [egenix-users] In-Reply-To: References: Message-ID: Am 01.10.2007, 15:35 Uhr, schrieb Y Tu : > Hi, > I'm a newbie for the Python and wanna install Biopython on my new > MacBook Pro (intel chip). As a requirement of BioPytbon, I downloaded > and installed mxtext tool. However, I got the following error message. > Could someone help me to fix the problem? Thank you very much. > lizhexu$ sudo python setup.py install Dear Y, the mx tools are already compiled which is why you get the error. sudo python setup.py build --skip install is correct even it looks strange Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From ytu888 at hotmail.com Mon Oct 1 09:54:48 2007 From: ytu888 at hotmail.com (Y Tu) Date: Mon Oct 1 15:54:59 2007 Subject: [egenix-users] In-Reply-To: References: Message-ID: Thank you very much Charlie, for the prompt answer. With the command you suggested, it seems work, at least no error message showed. However, when I tested with the import statement at the Python prompt, I got the following error. What's wrong? Thanks. leesComputer:/applications/Python_Bio/egenix-mx-base-3.0.0.macosx-10.3-fat-py2.5_ucs4.prebuilt lee$ python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx import TextTools Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/__init__.py", line 8, in from TextTools import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/TextTools.py", line 13, in from mxTextTools import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/__init__.py", line 8, in from mxTextTools import * ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/mxTextTools.so, 2): Symbol not found: __PyUnicodeUCS4_ToLowercase Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/mxTextTools.so Expected in: dynamic lookup > Date: Mon, 1 Oct 2007 15:39:17 +0200 > To: ytu888@hotmail.com; egenix-users@egenix.com > Subject: Re: [egenix-users] > From: charlie@egenix.com > > Am 01.10.2007, 15:35 Uhr, schrieb Y Tu : > > > Hi, > > I'm a newbie for the Python and wanna install Biopython on my new > > MacBook Pro (intel chip). As a requirement of BioPytbon, I downloaded > > and installed mxtext tool. However, I got the following error message. > > Could someone help me to fix the problem? Thank you very much. > > > lizhexu$ sudo python setup.py install > > Dear Y, > > the mx tools are already compiled which is why you get the error. > > sudo python setup.py build --skip install > > is correct even it looks strange > > Charlie > -- > Charlie Clark > eGenix.com > > Professional Python Services directly from the Source > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > > :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 _________________________________________________________________ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20071001/8de9d91a/attachment.htm From charlie at egenix.com Mon Oct 1 17:16:17 2007 From: charlie at egenix.com (Charlie Clark) Date: Mon Oct 1 16:16:23 2007 Subject: [egenix-users] In-Reply-To: References: Message-ID: Am 01.10.2007, 15:54 Uhr, schrieb Y Tu : > > Thank you very much Charlie, for the prompt answer. > With the command you suggested, it seems work, at least no error message > showed. However, when I tested with the import statement at the Python > prompt, I got the following error. What's wrong? Thanks. cd to your home folder. If you call Python from the install folder you will confuse it as it finds the module locally but with the wrong path. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From ytu888 at hotmail.com Mon Oct 1 10:38:09 2007 From: ytu888 at hotmail.com (Y Tu) Date: Mon Oct 1 16:38:23 2007 Subject: [egenix-users] In-Reply-To: References: Message-ID: Hi Charlie, I have two account, one is ryan, I used daily which does not have the administrator's duty, another is lee. I did the installation under ryan's account but using su lee. I changed back to ryan's account and back to the home directory. The command generated the following error: leesComputer:~ ryan$ python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx import TextTools Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/__init__.py", line 8, in from TextTools import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/TextTools.py", line 13, in from mxTextTools import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/__init__.py", line 8, in from mxTextTools import * ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/mxTextTools.so, 2): Symbol not found: __PyUnicodeUCS4_ToLowercase Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/mxTextTools.so Expected in: dynamic lookup Then I tested under Lee's account from the home directory, but got: Last login: Mon Oct 1 10:26:59 on console Welcome to Darwin! leesComputer:~ lee$ python Python 2.3.5 (#1, Dec 7 2006, 14:50:51) [GCC 4.0.1 (Apple Computer, Inc. build 5363) (+4864187)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from mx import TextTools Traceback (most recent call last): File "", line 1, in ? ImportError: No module named mx What's wrong? Please help me. Thanks. > Date: Mon, 1 Oct 2007 16:16:17 +0200 > To: ytu888@hotmail.com; egenix-users@egenix.com > Subject: Re: [egenix-users] > From: charlie@egenix.com > > Am 01.10.2007, 15:54 Uhr, schrieb Y Tu : > > > > > Thank you very much Charlie, for the prompt answer. > > With the command you suggested, it seems work, at least no error message > > showed. However, when I tested with the import statement at the Python > > prompt, I got the following error. What's wrong? Thanks. > > cd to your home folder. If you call Python from the install folder you > will confuse it as it finds the module locally but with the wrong path. > > Charlie > > -- > Charlie Clark > eGenix.com > > Professional Python Services directly from the Source > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > > :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 _________________________________________________________________ Discover the new Windows Vista http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20071001/5c49c3a5/attachment.htm From ytu888 at hotmail.com Mon Oct 1 14:51:31 2007 From: ytu888 at hotmail.com (Y Tu) Date: Mon Oct 1 20:53:08 2007 Subject: [egenix-users] Error on Mac with mxText In-Reply-To: References: Message-ID: Hi Charlie, I repeated the installation of mxTool with Admin account, since I got the following error messages when installing biopython ========================== leeComputer:/applications/Python_Bio/biopython-1.43 lee$ sudo python setup.py install running install *** mxTextTools *** is either not installed or out of date. This package is required for many Biopython features. Please install it before you install Biopython. You can find mxTextTools at http://www.egenix.com/files/python/eGenix-mx-Extensions.html. I did the installation following your suggestion; =========================== leesComputer:/applications/python_Bio/egenix-mx-base-3.0.0.macosx-10.3-fat-py2.5_ucs4.prebuilt lee$ sudo python setup.py build --skip install running build skipping the build process and reusing the existing build files and data restoring build data from a previous build run running install running install_lib running build_ext writing byte-compilation script '/tmp/tmpmrkGBX.py' /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python -O /tmp/tmpmrkGBX.py removing /tmp/tmpmrkGBX.py running install_data running install_egg_info Removing /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/egenix_mx_base-3.0.0-py2.5.egg-info Writing /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/egenix_mx_base-3.0.0-py2.5.egg-info However, when I tested the installation I got ============================ >>> from mx import TextTools Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/__init__.py", line 8, in from TextTools import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/TextTools.py", line 13, in from mxTextTools import * File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/__init__.py", line 8, in from mxTextTools import * ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/mxTextTools.so, 2): Symbol not found: __PyUnicodeUCS4_ToLowercase Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/mx/TextTools/mxTextTools/mxTextTools.so Expected in: dynamic lookup Any suggestions to fix the problem? Thank you so much. _________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline From charlie at egenix.com Tue Oct 2 16:48:38 2007 From: charlie at egenix.com (Charlie Clark) Date: Tue Oct 2 15:48:48 2007 Subject: [egenix-users] Re: Error on Mac with mxText In-Reply-To: References: Message-ID: Dear Y, Am 01.10.2007, 20:51 Uhr, schrieb Y Tu : > leesComputer:/applications/python_Bio/egenix-mx-base-3.0.0.macosx-10.3-fat-py2.5_ucs4.prebuilt couldn't see the wood for the trees. It looks like you downloaded the wrong version for your version of Python. Python on MacOS X is UCS2 by default and you downloaded the UCS4 version. Please try the UCS2 version. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From ytu888 at hotmail.com Tue Oct 2 10:17:11 2007 From: ytu888 at hotmail.com (Y Tu) Date: Tue Oct 2 16:17:23 2007 Subject: [egenix-users] RE: Error on Mac with mxText In-Reply-To: References: Message-ID: Dear Charlie, When I download the file from egenix, I noticed the version of ucs2. My Mac came with Python 2.3 preloaded. I downloaded python-2.5.1-macosx.dmg and updated it to python 2.5.1 already. Therefore I tried to use ucs4. So even in this case, I still need to use ucs2? BTW, could you explain what ucs stands for? Thank you very much. > Date: Tue, 2 Oct 2007 15:48:38 +0200 > To: ytu888@hotmail.com > Subject: Re: Error on Mac with mxText > From: charlie@egenix.com > CC: egenix-users@egenix.com; biopython@freeserve.co.uk > > Dear Y, > > Am 01.10.2007, 20:51 Uhr, schrieb Y Tu : > > > leesComputer:/applications/python_Bio/egenix-mx-base-3.0.0.macosx-10.3-fat-py2.5_ucs4.prebuilt > > couldn't see the wood for the trees. It looks like you downloaded the > wrong version for your version of Python. Python on MacOS X is UCS2 by > default and you downloaded the UCS4 version. Please try the UCS2 version. > > Charlie > > -- > Charlie Clark > eGenix.com > > Professional Python Services directly from the Source > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > > :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 _________________________________________________________________ Help yourself to FREE treats served up daily at the Messenger Caf?. Stop by today. http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20071002/bfa4719f/attachment.htm From charlie at egenix.com Wed Oct 3 00:31:40 2007 From: charlie at egenix.com (Charlie Clark) Date: Tue Oct 2 23:31:53 2007 Subject: [egenix-users] Re: Error on Mac with mxText In-Reply-To: References: Message-ID: Am 02.10.2007, 16:17 Uhr, schrieb Y Tu : > Dear Charlie, > When I download the file from egenix, I noticed the version of ucs2. My > Mac came with Python 2.3 preloaded. I downloaded python-2.5.1-macosx.dmg > and updated it to python 2.5.1 already. Therefore I tried to use ucs4. > So even in this case, I still need to use ucs2? BTW, could you explain > what ucs stands for? UCS refers to the version of unicode: 2 or 4 bytes. Mac OS X uses UCS2 by default so you should install the UCS2 download for Python 2.5 Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From ytu888 at hotmail.com Wed Oct 3 07:11:18 2007 From: ytu888 at hotmail.com (Y Tu) Date: Wed Oct 3 13:11:29 2007 Subject: [egenix-users] RE: Error on Mac with mxText In-Reply-To: References: Message-ID: Thank you very much, Charlie. It solved my problem. > Date: Tue, 2 Oct 2007 23:31:40 +0200 > To: ytu888@hotmail.com > Subject: Re: Error on Mac with mxText > From: charlie@egenix.com > CC: egenix-users@egenix.com; biopython@freeserve.co.uk > > Am 02.10.2007, 16:17 Uhr, schrieb Y Tu : > > > Dear Charlie, > > > When I download the file from egenix, I noticed the version of ucs2. My > > Mac came with Python 2.3 preloaded. I downloaded python-2.5.1-macosx.dmg > > and updated it to python 2.5.1 already. Therefore I tried to use ucs4. > > So even in this case, I still need to use ucs2? BTW, could you explain > > what ucs stands for? > > UCS refers to the version of unicode: 2 or 4 bytes. Mac OS X uses UCS2 by > default so you should install the UCS2 download for Python 2.5 > > Charlie > > -- > Charlie Clark > eGenix.com > > Professional Python Services directly from the Source > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > > :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 _________________________________________________________________ Windows Live Hotmail and Microsoft Office Outlook ? together at last. ?Get it now. http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033-------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20071003/bb21ae6c/attachment.htm From griffmcc at comcast.net Sat Oct 13 00:56:09 2007 From: griffmcc at comcast.net (Griff McClellan) Date: Sat Oct 13 08:56:24 2007 Subject: [egenix-users] hangs: import mx.ODBC.unixODBC Message-ID: <18e201c80d66$22d615a0$6400a8c0@Win> Hello, I have been using mxODBC 2.0.5 and python 2.3 with no problems for over six months. Suddenly, my python scripts that import mx.ODBC.unixODBC don't work. The problem is that when I import that module, the python interpreter hangs. Further, if I type control-C and then import again, the interpreter imports successfully. Here's a session that demonstrates the problem: [oracle@lin ~]$ python Python 2.3.4 (#1, Jan 9 2007, 16:40:18) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import sys # just to show that importing works >>> >>> import mx.ODBC.unixODBC ...hanging...^C Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/mx/ODBC/unixODBC/__init__.py", line 8, in ? from mxODBC import * KeyboardInterrupt >>> >>> import mx.ODBC.unixODBC >>> >>> mx.ODBC.__version__ '2.0.1' >>> If I go to /usr/lib/python2.3/site-packages/mx, where my installation resides, I see the same problem. [oracle@lin python]$ cd /usr/lib/python2.3/site-packages/mx/ODBC/unixODBC/ [oracle@lin unixODBC]$ [oracle@lin unixODBC]$ python Python 2.3.4 (#1, Jan 9 2007, 16:40:18) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import mxODBC ...hanging...^C Traceback (most recent call last): File "", line 1, in ? KeyboardInterrupt >>> >>> import mxODBC >>> >>> mxODBC.__version__ '2.0.5' >>> My database is Oracle 10g and my OS is Red Hat Enterprise Linux ES release 4 (Nahant Update 4). The database seems to work fine although a tablespace did fill up around the time the import stopped working. I haven't been able to get test.py to work because I can't find a connect arguments it will accept. Any ideas what the problem could be? Thanks, Griff -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20071012/a2b7a827/attachment.htm From charlie at egenix.com Sat Oct 13 12:03:45 2007 From: charlie at egenix.com (Charlie Clark) Date: Sat Oct 13 11:04:19 2007 Subject: [egenix-users] hangs: import mx.ODBC.unixODBC In-Reply-To: <18e201c80d66$22d615a0$6400a8c0@Win> References: <18e201c80d66$22d615a0$6400a8c0@Win> Message-ID: Am 13.10.2007, 08:56 Uhr, schrieb Griff McClellan : > Hello, > I have been using mxODBC 2.0.5 and python 2.3 with no problems for over > six months. Suddenly, my python scripts that import mx.ODBC.unixODBC > don't work. The problem is that when I import that module, the python > interpreter hangs. Further, if I type control-C and then import again, > the interpreter imports successfully. Here's a session that > demonstrates the problem: > [oracle@lin ~]$ python > Python 2.3.4 (#1, Jan 9 2007, 16:40:18) > [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> >>>> import sys # just to show that importing works >>>> >>>> import mx.ODBC.unixODBC > ...hanging...^C If you haven't done anything with Python or mxODBC then the problem won't be there and my guess is that something has changed with the libodbc.so you are using. You might try running Python in verbose mode for more information as to where Python is hanging. By the way I can't find a record of your licence. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Mon Oct 22 13:43:24 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 22 12:43:38 2007 Subject: [egenix-users] mxODBC on Debian stable Message-ID: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> I am going to install mxODBC on a managed Debian box. What packages do I ask the hoster to install for me? On Debian mxBase has been split into several packages, and I'd rather not install any more than I need to. I assume at least the following: python2.4-dev python-egenix-mxdatetime Any others? The full list of debian packages is: http://packages.debian.org/search?keywords=python-egenix&searchon=names&suite=stable§ion=all Note that python-egenix-mxtools is a dependency for all other python-exegenix-mx* packages and get's installed automatically. -- Martijn Pieters From mal at egenix.com Mon Oct 22 13:51:05 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 22 12:51:11 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> Message-ID: <471C8099.3040103@egenix.com> Hi Martijn, On 2007-10-22 12:43, Martijn Pieters wrote: > I am going to install mxODBC on a managed Debian box. What packages do > I ask the hoster to install for me? On Debian mxBase has been split > into several packages, and I'd rather not install any more than I need > to. I assume at least the following: > > python2.4-dev > python-egenix-mxdatetime mxODBC (currently) only needs mxDateTime to be installed. > Any others? The full list of debian packages is: > http://packages.debian.org/search?keywords=python-egenix&searchon=names&suite=stable§ion=all > > Note that python-egenix-mxtools is a dependency for all other > python-exegenix-mx* packages and get's installed automatically. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mal at egenix.com Mon Oct 22 13:54:41 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 22 12:54:46 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: <471C8099.3040103@egenix.com> References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> <471C8099.3040103@egenix.com> Message-ID: <471C8171.1040006@egenix.com> On 2007-10-22 12:51, M.-A. Lemburg wrote: > Hi Martijn, > > On 2007-10-22 12:43, Martijn Pieters wrote: >> I am going to install mxODBC on a managed Debian box. What packages do >> I ask the hoster to install for me? On Debian mxBase has been split >> into several packages, and I'd rather not install any more than I need >> to. I assume at least the following: >> >> python2.4-dev >> python-egenix-mxdatetime > > mxODBC (currently) only needs mxDateTime to be installed. Hmm, looking at http://packages.debian.org/etch/python-egenix-mxdatetime it seems they still haven't upgraded to the 3.0 versions of the mx Base packages. mxODBC 3.0 should also run with the mxDateTime 2.0 version, but it's usually better to install the latest stable releases of the mx packages, since that's the combination of packages that we use for testing. >> Any others? The full list of debian packages is: >> http://packages.debian.org/search?keywords=python-egenix&searchon=names&suite=stable§ion=all >> >> Note that python-egenix-mxtools is a dependency for all other >> python-exegenix-mx* packages and get's installed automatically. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Mon Oct 22 13:58:40 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 22 12:59:14 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: <471C8171.1040006@egenix.com> References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> <471C8099.3040103@egenix.com> <471C8171.1040006@egenix.com> Message-ID: <21a6ef160710220358k36f57711sc3a3001ded6ebe49@mail.gmail.com> On 10/22/07, M.-A. Lemburg wrote: > > mxODBC (currently) only needs mxDateTime to be installed. > > Hmm, looking at > > http://packages.debian.org/etch/python-egenix-mxdatetime > > it seems they still haven't upgraded to the 3.0 versions of > the mx Base packages. > > mxODBC 3.0 should also run with the mxDateTime 2.0 version, > but it's usually better to install the latest stable releases > of the mx packages, since that's the combination of packages > that we use for testing. Thanks Marc-Andr?. If I run into problems, I'll use a local install of the latest version. Is mxDateTime available as an egg, perchance? -- Martijn Pieters From mal at egenix.com Mon Oct 22 14:19:15 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 22 13:19:21 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: <21a6ef160710220358k36f57711sc3a3001ded6ebe49@mail.gmail.com> References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> <471C8099.3040103@egenix.com> <471C8171.1040006@egenix.com> <21a6ef160710220358k36f57711sc3a3001ded6ebe49@mail.gmail.com> Message-ID: <471C8733.2040303@egenix.com> On 2007-10-22 12:58, Martijn Pieters wrote: > On 10/22/07, M.-A. Lemburg wrote: >>> mxODBC (currently) only needs mxDateTime to be installed. >> Hmm, looking at >> >> http://packages.debian.org/etch/python-egenix-mxdatetime >> >> it seems they still haven't upgraded to the 3.0 versions of >> the mx Base packages. >> >> mxODBC 3.0 should also run with the mxDateTime 2.0 version, >> but it's usually better to install the latest stable releases >> of the mx packages, since that's the combination of packages >> that we use for testing. > > Thanks Marc-Andr?. If I run into problems, I'll use a local install of > the latest version. Is mxDateTime available as an egg, perchance? No, but it's available as prebuilt binary, which can be installed in much the same way (and without all the sys.path fuzz that setuptools requires): http://www.egenix.com/products/python/mxBase/#Installation which allows you to use the regular distutils install command to do the installation, skipping the build step: python setup.py build --skip install -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Mon Oct 22 14:24:07 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 22 13:24:14 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: <471C8733.2040303@egenix.com> References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> <471C8099.3040103@egenix.com> <471C8171.1040006@egenix.com> <21a6ef160710220358k36f57711sc3a3001ded6ebe49@mail.gmail.com> <471C8733.2040303@egenix.com> Message-ID: <21a6ef160710220424w28edd31w775f5d0b5eaabf1@mail.gmail.com> On 10/22/07, M.-A. Lemburg wrote: > > Thanks Marc-Andr?. If I run into problems, I'll use a local install of > > the latest version. Is mxDateTime available as an egg, perchance? > > No, but it's available as prebuilt binary, which can be installed > in much the same way (and without all the sys.path fuzz that setuptools > requires): > > http://www.egenix.com/products/python/mxBase/#Installation > > which allows you to use the regular distutils install command > to do the installation, skipping the build step: > > python setup.py build --skip install We don't mind the setuptools sys.path fuzz (it has it's advantages) and use buildout for our deployments, which takes most of the hassle out of repeatable deployments. This does mean I'll need to write a recipe for the mxBase package. Note that in my case it's not the compilation step that's the problem, it's having to use explicit steps to install the code, whilst just naming an egg in the buildout configuration would have been easier for me. -- Martijn Pieters From charlie at egenix.com Mon Oct 22 14:27:20 2007 From: charlie at egenix.com (Charlie Clark) Date: Mon Oct 22 13:29:41 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: <21a6ef160710220424w28edd31w775f5d0b5eaabf1@mail.gmail.com> References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> <471C8099.3040103@egenix.com> <471C8171.1040006@egenix.com> <21a6ef160710220358k36f57711sc3a3001ded6ebe49@mail.gmail.com> <471C8733.2040303@egenix.com> <21a6ef160710220424w28edd31w775f5d0b5eaabf1@mail.gmail.com> Message-ID: Am 22.10.2007, 13:24 Uhr, schrieb Martijn Pieters : > Note that in my case it's not the compilation step that's the problem, > it's having to use explicit steps to install the code, whilst just > naming an egg in the buildout configuration would have been easier for > me. Wouldn't it be possible to get buildout to work with distutils? Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mal at egenix.com Mon Oct 22 14:43:36 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 22 13:43:41 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: <21a6ef160710220424w28edd31w775f5d0b5eaabf1@mail.gmail.com> References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> <471C8099.3040103@egenix.com> <21a6ef160710220358k36f57711sc3a3001ded6ebe49@mail.gmail.com> <471C8733.2040303@egenix.com> <21a6ef160710220424w28edd31w775f5d0b5eaabf1@mail.gmail.com> Message-ID: <471C8CE8.1010504@egenix.com> On 2007-10-22 13:24, Martijn Pieters wrote: > On 10/22/07, M.-A. Lemburg wrote: >>> Thanks Marc-Andr?. If I run into problems, I'll use a local install of >>> the latest version. Is mxDateTime available as an egg, perchance? >> No, but it's available as prebuilt binary, which can be installed >> in much the same way (and without all the sys.path fuzz that setuptools >> requires): >> >> http://www.egenix.com/products/python/mxBase/#Installation >> >> which allows you to use the regular distutils install command >> to do the installation, skipping the build step: >> >> python setup.py build --skip install > > We don't mind the setuptools sys.path fuzz (it has it's advantages) > and use buildout for our deployments, which takes most of the hassle > out of repeatable deployments. This does mean I'll need to write a > recipe for the mxBase package. > > Note that in my case it's not the compilation step that's the problem, > it's having to use explicit steps to install the code, whilst just > naming an egg in the buildout configuration would have been easier for > me. One of these days, we're going to add a way to build egg ZIP files as well. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Mon Oct 22 15:01:54 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 22 14:02:03 2007 Subject: [egenix-users] mxODBC on Debian stable In-Reply-To: References: <21a6ef160710220343h138296c9g6e317492d479b6ee@mail.gmail.com> <471C8099.3040103@egenix.com> <471C8171.1040006@egenix.com> <21a6ef160710220358k36f57711sc3a3001ded6ebe49@mail.gmail.com> <471C8733.2040303@egenix.com> <21a6ef160710220424w28edd31w775f5d0b5eaabf1@mail.gmail.com> Message-ID: <21a6ef160710220501s19cb4768q5f8932cc433bb597@mail.gmail.com> On 10/22/07, Charlie Clark wrote: > Wouldn't it be possible to get buildout to work with distutils? It does already work with distutils, but an egg would have been easier for us. -- Martijn Pieters From SNewman at tbo.com Wed Oct 24 13:54:54 2007 From: SNewman at tbo.com (SNewman@tbo.com) Date: Wed Oct 24 18:55:02 2007 Subject: [egenix-users] Trouble building 64-bit Version of mxDateTime (prebuilt and source) Message-ID: I'm trying to build mx.DateTime on my 64-bit CentOS machine so I can build Psycopg2. When I compile from source, I get this error (after many warnings and errors from mxDatetime.c) {standard input}: Assembler messages: {standard input}:165: Warning: size of "day" is already 1; not changing to 8 error: command 'gcc' failed with exit status 1 When I try to install the prebuilt version, I get errors that it couldn't find mx/mxDatetime.c. When I look in the mx directory, it's empty except for a directory called "Docs". Alternatively, does anyone know what would happen if I tried installing the 32-bit version? Thanks in advance, Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20071024/47e70fa2/attachment.htm From mal at egenix.com Wed Oct 24 23:28:40 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Oct 24 22:28:44 2007 Subject: [egenix-users] Trouble building 64-bit Version of mxDateTime (prebuilt and source) In-Reply-To: References: Message-ID: <471FAAF8.3040108@egenix.com> SNewman@tbo.com wrote: > I'm trying to build mx.DateTime on my 64-bit CentOS machine so I can > build Psycopg2. > > > > When I compile from source, I get this error (after many warnings and > errors from mxDatetime.c) > > > > {standard input}: Assembler messages: > > {standard input}:165: Warning: size of "day" is already 1; not changing > to 8 > > error: command 'gcc' failed with exit status 1 You should send the complete dump of warnings and messages, since gcc tries to continue compiling even if it finds an error early on. > When I try to install the prebuilt version, I get errors that it > couldn't find mx/mxDatetime.c. When I look in the mx directory, it's > empty except for a directory called "Docs". Did you install the prebuilt version using python setup.py build --skip install ? Note that the "build --skip" is necessary, since otherwise distutils will try to build the package again, which fails, since the prebuilt packages don't include the source code. > Alternatively, does anyone know what would happen if I tried installing > the 32-bit version? That won't work: a 64-bit process cannot load 32-bit libraries. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 24 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Sun Oct 28 17:09:40 2007 From: mj at zopatista.com (Martijn Pieters) Date: Sun Oct 28 16:09:51 2007 Subject: [egenix-users] ODBC encoding problems Message-ID: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> I am running into an encoding problem, where anything outside of base ASCII charset results in ODBC errors. The same rows can be fetched with isql without any problems. The setup uses the FreeTDS driver to connect to a MS-SQL database, and the error I get is: ('42000', 2403, "[unixODBC][FreeTDS][SQL Server]WARNING! Some character(s) could not be converted into client's character set. Unconverted bytes were changed to question marks ('?').", 5125) I am unable to determine where the client's character set is set, the .encoding parameter on the mx.ODBC connection doesn't influence this. Any hints on where to start debugging this? Note that the same query in isql does not produce the error and returns the characters in question without problems. The data in question uses latin-1 characters only. -- Martijn Pieters From mj at zopatista.com Sun Oct 28 17:33:16 2007 From: mj at zopatista.com (Martijn Pieters) Date: Sun Oct 28 16:33:29 2007 Subject: [egenix-users] Re: ODBC encoding problems In-Reply-To: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> Message-ID: <21a6ef160710280833u1dc5edc1q22933a73d703fc39@mail.gmail.com> On 10/28/07, Martijn Pieters wrote: > I am running into an encoding problem, where anything outside of base > ASCII charset results in ODBC errors. The same rows can be fetched > with isql without any problems. I am now realizing that mx.ODBC is compiled with explicit FreeTDS support. Has this support been compiled in statically? If so, what version of FreeTDS has been used? If a different version than the one on Debian (0.63-3.2) has been used, it could be that the version used by mx.ODBC has charset conversion problems. Other problems may include different defaults set in the driver, or no iconv support included. -- Martijn Pieters From mal at egenix.com Sun Oct 28 16:34:22 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Oct 28 16:34:28 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> Message-ID: <4724ABFE.7000300@egenix.com> On 2007-10-28 16:09, Martijn Pieters wrote: > I am running into an encoding problem, where anything outside of base > ASCII charset results in ODBC errors. The same rows can be fetched > with isql without any problems. > > The setup uses the FreeTDS driver to connect to a MS-SQL database, and > the error I get is: > > ('42000', 2403, "[unixODBC][FreeTDS][SQL Server]WARNING! Some > character(s) could not be converted into client's character set. > Unconverted bytes were changed to question marks ('?').", 5125) > > I am unable to determine where the client's character set is set, the > .encoding parameter on the mx.ODBC connection doesn't influence this. > > Any hints on where to start debugging this? Note that the same query > in isql does not produce the error and returns the characters in > question without problems. The data in question uses latin-1 > characters only. Please send the table schema and your freetds.conf entry. Also include information of whether you're using the default mxODBC configuration or one of the Unicode support modes. Also check: http://www.freetds.org/userguide/nonwestern.htm The fact that isql displays the characters only suggests that the FreeTDS ODBC driver tells mxODBC to fetch the character data using a non-SQLCHAR data type. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From charlie at egenix.com Sun Oct 28 16:35:53 2007 From: charlie at egenix.com (Charlie Clark) Date: Sun Oct 28 16:35:59 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> Message-ID: Am 28.10.2007, 16:09 Uhr, schrieb Martijn Pieters : > I am running into an encoding problem, where anything outside of base > ASCII charset results in ODBC errors. The same rows can be fetched > with isql without any problems. > The setup uses the FreeTDS driver to connect to a MS-SQL database, and > the error I get is: > ('42000', 2403, "[unixODBC][FreeTDS][SQL Server]WARNING! Some > character(s) could not be converted into client's character set. > Unconverted bytes were changed to question marks ('?').", 5125) > I am unable to determine where the client's character set is set, the > .encoding parameter on the mx.ODBC connection doesn't influence this. You also need to set the string format ie. c.stringformat = mx.ODBC.UNICODE_STRINGFORMAT > Any hints on where to start debugging this? Note that the same query > in isql does not produce the error and returns the characters in > question without problems. The data in question uses latin-1 > characters only. We would always recommend running a test using a different driver as FreeTDS does not always give all the information needed. Charlie -- Charlie Clark eGenix.com Professional Python Services directly from the Source >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mal at egenix.com Sun Oct 28 16:39:44 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Oct 28 16:39:48 2007 Subject: [egenix-users] Re: ODBC encoding problems In-Reply-To: <21a6ef160710280833u1dc5edc1q22933a73d703fc39@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <21a6ef160710280833u1dc5edc1q22933a73d703fc39@mail.gmail.com> Message-ID: <4724AD40.1090601@egenix.com> On 2007-10-28 16:33, Martijn Pieters wrote: > On 10/28/07, Martijn Pieters wrote: >> I am running into an encoding problem, where anything outside of base >> ASCII charset results in ODBC errors. The same rows can be fetched >> with isql without any problems. > > I am now realizing that mx.ODBC is compiled with explicit FreeTDS > support. Has this support been compiled in statically? If so, what > version of FreeTDS has been used? > > If a different version than the one on Debian (0.63-3.2) has been > used, it could be that the version used by mx.ODBC has charset > conversion problems. > > Other problems may include different defaults set in the driver, or no > iconv support included. The included sub-package was compiled against FreeTDS 0.64. It's dynamically linked to the libtdsodbc.so.0 library. You should always use the latest available version of FreeTDS if possible. Their ODBC driver is still in the making and not as stable as the rest of FreeTDS. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Sun Oct 28 17:56:28 2007 From: mj at zopatista.com (Martijn Pieters) Date: Sun Oct 28 16:56:46 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <4724ABFE.7000300@egenix.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> Message-ID: <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> On 10/28/07, M.-A. Lemburg wrote: > Please send the table schema and your freetds.conf entry. Also > include information of whether you're using the default mxODBC > configuration or one of the Unicode support modes. Default configuration is used (using UNICODE_STRINGFORMAT doesn't make a difference in this respect). FreeTDS entry: [JazzForum] ; development host uses a ssh tunnel to connect host = localhost port = 1433 tds version = 8.0 No 'client charset' entry is set. I don't have detailed information on the tables other than what I can glean from isql (abbreviated to relevant information): +-------------------------+-----------+------------+---------+ | COLUMN_NAME | TYPE_NAME | LENGTH | NULLABLE| +-------------------------+-----------+------------+---------+ | contact_id | int | 4 | 0 | | name | varchar | 49 | 0 | | department | varchar | 39 | 1 | | userdef_id | int | 4 | 1 | +-------------------------+-----------+------------+---------+ The offending columns are claimed to be simple varchars. > Also check: > > http://www.freetds.org/userguide/nonwestern.htm I am aware of that document, and already experimented with various client charset settings to no avail. I'll experiment with the Easysoft ODBC driver later this week (my family development-during-the-weekend credit has been used up..). -- Martijn Pieters From mal at egenix.com Sun Oct 28 21:09:06 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Oct 28 21:09:15 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> Message-ID: <4724EC62.6050405@egenix.com> On 2007-10-28 16:56, Martijn Pieters wrote: > On 10/28/07, M.-A. Lemburg wrote: >> Please send the table schema and your freetds.conf entry. Also >> include information of whether you're using the default mxODBC >> configuration or one of the Unicode support modes. > > Default configuration is used (using UNICODE_STRINGFORMAT doesn't make > a difference in this respect). > > FreeTDS entry: > > [JazzForum] > ; development host uses a ssh tunnel to connect > host = localhost > port = 1433 > tds version = 8.0 > > No 'client charset' entry is set. That should result in Latin-1 being used as default. > I don't have detailed information on the tables other than what I can > glean from isql (abbreviated to relevant information): > > +-------------------------+-----------+------------+---------+ > | COLUMN_NAME | TYPE_NAME | LENGTH | NULLABLE| > +-------------------------+-----------+------------+---------+ > | contact_id | int | 4 | 0 | > | name | varchar | 49 | 0 | > | department | varchar | 39 | 1 | > | userdef_id | int | 4 | 1 | > +-------------------------+-----------+------------+---------+ > > The offending columns are claimed to be simple varchars. Those shouldn't really cause the warnings you are seeing. We have seen such warnings in tests that try to store binary data in a NCHAR column, but not with VARCHAR columns. Do you get the warning when reading from the database or writing to it ? Do have the offending strings available ? We could then construct a test case to try against our SQL Server installation. >> Also check: >> >> http://www.freetds.org/userguide/nonwestern.htm > > I am aware of that document, and already experimented with various > client charset settings to no avail. > > I'll experiment with the Easysoft ODBC driver later this week (my > family development-during-the-weekend credit has been used up..). The EasySoft driver is a lot more reliable than FreeTDS. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Sun Oct 28 23:01:46 2007 From: mj at zopatista.com (Martijn Pieters) Date: Sun Oct 28 22:01:54 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <4724EC62.6050405@egenix.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> <4724EC62.6050405@egenix.com> Message-ID: <21a6ef160710281401o332d14f3jf3efb82bdda8061e@mail.gmail.com> On 10/28/07, M.-A. Lemburg wrote: > > No 'client charset' entry is set. > > That should result in Latin-1 being used as default. Indeed, and the isql client has no problem showing encoded results. > > +-------------------------+-----------+------------+---------+ > > | COLUMN_NAME | TYPE_NAME | LENGTH | NULLABLE| > > +-------------------------+-----------+------------+---------+ > > | contact_id | int | 4 | 0 | > > | name | varchar | 49 | 0 | > > | department | varchar | 39 | 1 | > > | userdef_id | int | 4 | 1 | > > +-------------------------+-----------+------------+---------+ > > > > The offending columns are claimed to be simple varchars. > > Those shouldn't really cause the warnings you are seeing. > We have seen such warnings in tests that try to store > binary data in a NCHAR column, but not with VARCHAR columns. > > Do you get the warning when reading from the database or > writing to it ? Reading. I have no write access. > Do have the offending strings available ? We could > then construct a test case to try against our SQL Server > installation. Here are the first 2 rows as comma-separated values, which happen to be public company names. 2, SuperOffice Norge AS, ?stnorsk, 2 3, Norsk Jazzforum, ?stnorsk, 1453 In case email encoding gets mucked up, that's 2 times O with / (unicode 00D8) in the 'department' column (don't ask why the department column holds a region in Norway). -- Martijn Pieters From mj at zopatista.com Mon Oct 29 10:44:26 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 29 09:44:43 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <21a6ef160710281401o332d14f3jf3efb82bdda8061e@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> <4724EC62.6050405@egenix.com> <21a6ef160710281401o332d14f3jf3efb82bdda8061e@mail.gmail.com> Message-ID: <21a6ef160710290144u3727bd45q99c466b6b6d1459c@mail.gmail.com> On 10/28/07, Martijn Pieters wrote: > Here are the first 2 rows as comma-separated values, which happen to > be public company names. > 2, SuperOffice Norge AS, ?stnorsk, 2 > 3, Norsk Jazzforum, ?stnorsk, 1453 > > In case email encoding gets mucked up, that's 2 times O with / > (unicode 00D8) in the 'department' column (don't ask why the > department column holds a region in Norway). I used the TDSDUMP environment variable to trace the problem. isql sets the character set to UTF-8, while for mx.ODBC, the character set appears to be set to ASCII! Here is the relevant section for the mx.ODBC query 'select deparment from CRM5.contact where contact_id=2': 09:39:20.790301 Received packet 0000 81 01 00 00 00 09 00 a7-27 00 06 04 d0 00 00 0a |........ '.......| 0010 64 00 65 00 70 00 61 00-72 00 74 00 6d 00 65 00 |d.e.p.a. r.t.m.e.| 0020 6e 00 74 00 d1 08 00 d8-73 74 6e 6f 72 73 6b fd |n.t..... stnorsk.| 0030 10 00 c1 00 01 00 00 00- |........| 09:39:20.790339 processing result tokens. marker is 81(TDS7_RESULT) 09:39:20.790461 tds_free_all_results() 09:39:20.790490 processing TDS7 result. set current_results to tds->res_info 09:39:20.790512 adjust_character_column_size: Server charset: CP1252 Server column_size: 39 Client charset: US-ASCII Client column_size: 39 When querying from isql instead, the same section of the log reads: 09:35:07.428719 Received packet 0000 81 01 00 00 00 09 00 a7-27 00 06 04 d0 00 00 0a |........ '.......| 0010 64 00 65 00 70 00 61 00-72 00 74 00 6d 00 65 00 |d.e.p.a. r.t.m.e.| 0020 6e 00 74 00 d1 08 00 d8-73 74 6e 6f 72 73 6b ff |n.t..... stnorsk.| 0030 11 00 c1 00 01 00 00 00-79 00 00 00 00 fe 00 00 |........ y.......| 0040 e0 00 01 00 00 00 - |......| 09:35:07.428756 processing result tokens. marker is 81(TDS7_RESULT) 09:35:07.428796 tds_free_all_results() 09:35:07.428820 processing TDS7 result. set current_results to tds->res_info 09:35:07.428840 adjust_character_column_size: Server charset: CP1252 Server column_size: 39 Client charset: UTF-8 Client column_size: 156 The question remains then how freetds determines the client charset. I'll experiment with setting client charset explicitly. -- Martijn Pieters From mj at zopatista.com Mon Oct 29 10:50:11 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 29 09:50:32 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <21a6ef160710290144u3727bd45q99c466b6b6d1459c@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> <4724EC62.6050405@egenix.com> <21a6ef160710281401o332d14f3jf3efb82bdda8061e@mail.gmail.com> <21a6ef160710290144u3727bd45q99c466b6b6d1459c@mail.gmail.com> Message-ID: <21a6ef160710290150k2bda394cp8cd251b5f98cdc27@mail.gmail.com> On 10/29/07, Martijn Pieters wrote: > I used the TDSDUMP environment variable to trace the problem. isql > sets the character set to UTF-8, while for mx.ODBC, the character set > appears to be set to ASCII! In fact, the library thinks its "ANSI_X3.4-1968" according to the first lines of the log. I attached TDSDUMP logs for both sessions so you can see if there are any other important details. -- Martijn Pieters -------------- next part -------------- A non-text attachment was scrubbed... Name: mxODBC.log Type: application/octet-stream Size: 13094 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20071029/82502040/mxODBC.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: isql.log Type: application/octet-stream Size: 21661 bytes Desc: not available Url : /mailman-archives/egenix-users/attachments/20071029/82502040/isql.obj From mal at egenix.com Mon Oct 29 10:48:59 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 29 10:49:11 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <21a6ef160710290144u3727bd45q99c466b6b6d1459c@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> <4724EC62.6050405@egenix.com> <21a6ef160710281401o332d14f3jf3efb82bdda8061e@mail.gmail.com> <21a6ef160710290144u3727bd45q99c466b6b6d1459c@mail.gmail.com> Message-ID: <4725AC8B.3090603@egenix.com> On 2007-10-29 09:44, Martijn Pieters wrote: > On 10/28/07, Martijn Pieters wrote: >> Here are the first 2 rows as comma-separated values, which happen to >> be public company names. >> 2, SuperOffice Norge AS, ?stnorsk, 2 >> 3, Norsk Jazzforum, ?stnorsk, 1453 >> >> In case email encoding gets mucked up, that's 2 times O with / >> (unicode 00D8) in the 'department' column (don't ask why the >> department column holds a region in Norway). > > I used the TDSDUMP environment variable to trace the problem. isql > sets the character set to UTF-8, while for mx.ODBC, the character set > appears to be set to ASCII! mxODBC doesn't set the character set, it only makes an assumption of what the character set is in order to deal with Unicode conversions. This is what we get in the TDS log file when starting up our test suite: util.c:288:Starting log file for FreeTDS 0.64 on 2007-10-29 10:30:40 with debug flags 0x4fff. iconv.c:195:names for ISO-8859-1: ISO-8859-1 iconv.c:195:names for UTF-8: UTF-8 iconv.c:195:names for UCS-2LE: UCS-2LE iconv.c:195:names for UCS-2BE: UCS-2BE iconv.c:361:iconv to convert client-side data to the "ISO-8859-1" character set iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" iconv.c:514:tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE" and later on: token.c:3395:adjust_character_column_size: Server charset: CP1252 Server column_size: 100 Client charset: ISO-8859-1 Client column_size: 100 The Latin-1 encoding used is in line with our test results. > Here is the relevant section for the mx.ODBC query 'select deparment > from CRM5.contact where contact_id=2': > > 09:39:20.790301 Received packet > 0000 81 01 00 00 00 09 00 a7-27 00 06 04 d0 00 00 0a |........ '.......| > 0010 64 00 65 00 70 00 61 00-72 00 74 00 6d 00 65 00 |d.e.p.a. r.t.m.e.| > 0020 6e 00 74 00 d1 08 00 d8-73 74 6e 6f 72 73 6b fd |n.t..... stnorsk.| > 0030 10 00 c1 00 01 00 00 00- |........| > > 09:39:20.790339 processing result tokens. marker is 81(TDS7_RESULT) > 09:39:20.790461 tds_free_all_results() > 09:39:20.790490 processing TDS7 result. set current_results to tds->res_info > 09:39:20.790512 adjust_character_column_size: > Server charset: CP1252 > Server column_size: 39 > Client charset: US-ASCII > Client column_size: 39 > > When querying from isql instead, the same section of the log reads: > > 09:35:07.428719 Received packet > 0000 81 01 00 00 00 09 00 a7-27 00 06 04 d0 00 00 0a |........ '.......| > 0010 64 00 65 00 70 00 61 00-72 00 74 00 6d 00 65 00 |d.e.p.a. r.t.m.e.| > 0020 6e 00 74 00 d1 08 00 d8-73 74 6e 6f 72 73 6b ff |n.t..... stnorsk.| > 0030 11 00 c1 00 01 00 00 00-79 00 00 00 00 fe 00 00 |........ y.......| > 0040 e0 00 01 00 00 00 - |......| > > 09:35:07.428756 processing result tokens. marker is 81(TDS7_RESULT) > 09:35:07.428796 tds_free_all_results() > 09:35:07.428820 processing TDS7 result. set current_results to tds->res_info > 09:35:07.428840 adjust_character_column_size: > Server charset: CP1252 > Server column_size: 39 > Client charset: UTF-8 > Client column_size: 156 > > The question remains then how freetds determines the client charset. > I'll experiment with setting client charset explicitly. What's strange in your log output is that your freetds entry says: [JazzForum] ; development host uses a ssh tunnel to connect host = localhost port = 1433 tds version = 8.0 Yet the log suggests that TDS 7.0 is being used. Perhaps isql is setting the character set explicitly, while using the FreeTDS driver via mxODBC picks up a default encoding via some locale environment variable ? Try adding an explicit line client charset = ISO-8859-1 to your freetds.conf file. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mj at zopatista.com Mon Oct 29 11:30:12 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 29 11:30:56 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <4725AC8B.3090603@egenix.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> <4724EC62.6050405@egenix.com> <21a6ef160710281401o332d14f3jf3efb82bdda8061e@mail.gmail.com> <21a6ef160710290144u3727bd45q99c466b6b6d1459c@mail.gmail.com> <4725AC8B.3090603@egenix.com> Message-ID: <21a6ef160710290330s43d936n2b861119d29a310e@mail.gmail.com> On 10/29/07, M.-A. Lemburg wrote: > What's strange in your log output is that your freetds entry says: > > [JazzForum] > ; development host uses a ssh tunnel to connect > host = localhost > port = 1433 > tds version = 8.0 > > Yet the log suggests that TDS 7.0 is being used. I noticed this too. I did twiddle the setting at times, and cannot reproduce that now. > Perhaps isql is setting the character set explicitly, while using > the FreeTDS driver via mxODBC picks up a default encoding via > some locale environment variable ? > > Try adding an explicit line > > client charset = ISO-8859-1 > > to your freetds.conf file. BINGO. I had tried setting client charset to other values, just not to the default. But with this line added, mx.ODBC is given the correct character set too! Thanks, guys, for helping out here, we just saved ?499 on a EasySoft ODBC driver license. -- Martijn Pieters From mj at zopatista.com Mon Oct 29 12:26:34 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 29 12:26:41 2007 Subject: [egenix-users] No iterator support? Message-ID: <21a6ef160710290426i20cfdfaag6a53ff2a154ac632@mail.gmail.com> Using python 2.4 here. I keep getting "TypeError: len() of unsized object" when trying to use a mx.ODBC cursor as an iterator: cursor.execute(query) for row in cursor: # do something with the row cursor does have an __iter__ and a next() method, and calling .next() does give me a result. Am I doing something wrong here? -- Martijn Pieters From mj at zopatista.com Mon Oct 29 12:35:36 2007 From: mj at zopatista.com (Martijn Pieters) Date: Mon Oct 29 12:35:43 2007 Subject: [egenix-users] Re: No iterator support? In-Reply-To: <21a6ef160710290426i20cfdfaag6a53ff2a154ac632@mail.gmail.com> References: <21a6ef160710290426i20cfdfaag6a53ff2a154ac632@mail.gmail.com> Message-ID: <21a6ef160710290435h4fb7b6c3i9c8d39ffac7bb19d@mail.gmail.com> On 10/29/07, Martijn Pieters wrote: > Using python 2.4 here. I keep getting "TypeError: len() of unsized > object" when trying to use a mx.ODBC cursor as an iterator: > > cursor.execute(query) > for row in cursor: > # do something with the row > > cursor does have an __iter__ and a next() method, and calling .next() > does give me a result. Am I doing something wrong here? The workaround for now is to define an iterator function: def _iter(cursor): while True: yield cursor.next() and use that in "for row in _iter(cursor):" -- Martijn Pieters From mal at egenix.com Mon Oct 29 12:58:14 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 29 12:58:19 2007 Subject: [egenix-users] Re: No iterator support? In-Reply-To: <21a6ef160710290435h4fb7b6c3i9c8d39ffac7bb19d@mail.gmail.com> References: <21a6ef160710290426i20cfdfaag6a53ff2a154ac632@mail.gmail.com> <21a6ef160710290435h4fb7b6c3i9c8d39ffac7bb19d@mail.gmail.com> Message-ID: <4725CAD6.4010200@egenix.com> On 2007-10-29 12:35, Martijn Pieters wrote: > On 10/29/07, Martijn Pieters wrote: >> Using python 2.4 here. I keep getting "TypeError: len() of unsized >> object" when trying to use a mx.ODBC cursor as an iterator: >> >> cursor.execute(query) >> for row in cursor: >> # do something with the row >> >> cursor does have an __iter__ and a next() method, and calling .next() >> does give me a result. Am I doing something wrong here? No, it should work like that. We'll have a look. > The workaround for now is to define an iterator function: > > def _iter(cursor): > while True: > yield cursor.next() > > and use that in "for row in _iter(cursor):" > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 From mal at egenix.com Mon Oct 29 14:15:27 2007 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Oct 29 14:15:32 2007 Subject: [egenix-users] ODBC encoding problems In-Reply-To: <21a6ef160710290330s43d936n2b861119d29a310e@mail.gmail.com> References: <21a6ef160710280809x7122a646y49a92ee99e59148c@mail.gmail.com> <4724ABFE.7000300@egenix.com> <21a6ef160710280856p48247a42s1932f85f1a083bdc@mail.gmail.com> <4724EC62.6050405@egenix.com> <21a6ef160710281401o332d14f3jf3efb82bdda8061e@mail.gmail.com> <21a6ef160710290144u3727bd45q99c466b6b6d1459c@mail.gmail.com> <4725AC8B.3090603@egenix.com> <21a6ef160710290330s43d936n2b861119d29a310e@mail.gmail.com> Message-ID: <4725DCEF.8020703@egenix.com> On 2007-10-29 11:30, Martijn Pieters wrote: >> Perhaps isql is setting the character set explicitly, while using >> the FreeTDS driver via mxODBC picks up a default encoding via >> some locale environment variable ? >> >> Try adding an explicit line >> >> client charset = ISO-8859-1 >> >> to your freetds.conf file. > > BINGO. I had tried setting client charset to other values, just not to > the default. But with this line added, mx.ODBC is given the correct > character set too! > > Thanks, guys, for helping out here, we just saved ?499 on a EasySoft > ODBC driver license. You're welcome :-) -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2007) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ :::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611