471,328 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,328 software developers and data experts.

RuntimeWarning: tp_compare

I'm getting the following exception when I call an external extension
(pytst):

/usr/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return -1 or -2 for
exception
return _active[_get_ident()]
Traceback (most recent call last):
File "testDataMiner2.py", line 77, in <module>
testPlace()
File "testDataMiner2.py", line 41, in testPlace
data = db.getDescription(event['id'])
File "testDataMiner2.py", line 28, in getDescription
return self.getRow(query, (id,))
File "../database.py", line 73, in getRow
self.readlock.acquire()
File "/usr/lib/python2.5/threading.py", line 94, in acquire
me = currentThread()
File "/usr/lib/python2.5/threading.py", line 697, in currentThread
return _active[_get_ident()]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfa' in position 52: ordinal
not in range(128)
awer
/usr/lib/python2.5/threading.py(700)currentThread()
-return _DummyThread()
Note that the error occurs *after* the call that I isolated as
affecting it (pytst.scan(), in the case). This doesn't happen for simple,
isolated cases, but googling for "tp_compare threading" shows a lot of
similar issues. Does anybody here know what this could be about? Any ideas
to debug or work around it?

--
Bruno Barberi Gnecco <brunobg_at_users.sourceforge.net>
I can read your mind, and you should be ashamed of yourself.
Oct 9 '07 #1
2 3997
On 10/9/07, Bruno Barberi Gnecco
<br***************@users.sourceforge.netwrote:
I'm getting the following exception when I call an external extension
(pytst):

/usr/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return -1 or -2 for
exception
return _active[_get_ident()]
Traceback (most recent call last):
File "testDataMiner2.py", line 77, in <module>
testPlace()
File "testDataMiner2.py", line 41, in testPlace
data = db.getDescription(event['id'])
File "testDataMiner2.py", line 28, in getDescription
return self.getRow(query, (id,))
File "../database.py", line 73, in getRow
self.readlock.acquire()
File "/usr/lib/python2.5/threading.py", line 94, in acquire
me = currentThread()
File "/usr/lib/python2.5/threading.py", line 697, in currentThread
return _active[_get_ident()]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfa' in position 52: ordinal
not in range(128)
awer
/usr/lib/python2.5/threading.py(700)currentThread()
-return _DummyThread()
Note that the error occurs *after* the call that I isolated as
affecting it (pytst.scan(), in the case). This doesn't happen for simple,
isolated cases, but googling for "tp_compare threading" shows a lot of
similar issues. Does anybody here know what this could be about? Any ideas
to debug or work around it?
The various thread issues in the traceback aside, it looks like the
problem is that you passed a unicode object to pytst, which only
accepts plain (ascii) strings.
Oct 9 '07 #2
Chris Mellon wrote:
On 10/9/07, Bruno Barberi Gnecco
<br***************@users.sourceforge.netwrote:
> I'm getting the following exception when I call an external extension
(pytst):

/usr/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return -1 or -2 for
exception
return _active[_get_ident()]
Traceback (most recent call last):
File "testDataMiner2.py", line 77, in <module>
testPlace()
File "testDataMiner2.py", line 41, in testPlace
data = db.getDescription(event['id'])
File "testDataMiner2.py", line 28, in getDescription
return self.getRow(query, (id,))
File "../database.py", line 73, in getRow
self.readlock.acquire()
File "/usr/lib/python2.5/threading.py", line 94, in acquire
me = currentThread()
File "/usr/lib/python2.5/threading.py", line 697, in currentThread
return _active[_get_ident()]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfa' in position 52: ordinal
not in range(128)
awer
/usr/lib/python2.5/threading.py(700)currentThread()
-return _DummyThread()
Note that the error occurs *after* the call that I isolated as
affecting it (pytst.scan(), in the case). This doesn't happen for simple,
isolated cases, but googling for "tp_compare threading" shows a lot of
similar issues. Does anybody here know what this could be about? Any ideas
to debug or work around it?


The various thread issues in the traceback aside, it looks like the
problem is that you passed a unicode object to pytst, which only
accepts plain (ascii) strings.
That seems to have solved it. Thanks!

--
Bruno Barberi Gnecco <brunobg_at_users.sourceforge.net>
There is no time like the pleasant.
Oct 11 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mensanator | last post: by
2 posts views Thread by Bryan Olson | last post: by
22 posts views Thread by Alex Martelli | last post: by
2 posts views Thread by ajikoe | last post: by
25 posts views Thread by Martin Manns | last post: by
reply views Thread by Kurt B. Kaiser | last post: by
1 post views Thread by billiejoex | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.