472,958 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 4077
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mensanator | last post by:
In the program that follows, I get the following warning message: collatz_.py:37: RuntimeWarning: tp_compare didn't return -1, 0 or 1 while b>1: In this case, b is a gmpy.mpz number. The...
3
by: Edwin Young | last post by:
Hi, I'm developing an application which is primarily in Python but has some C-coded extension modules. These modules aren't really useful to anyone other than the main application. The app works...
2
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to...
22
by: Alex Martelli | last post by:
I have fixed almost all of the outstanding bugreports and feature request for gmpy: divm doesn't leak memory any more, truediv and floordiv are implemented for all types, etc -- in the current CVS...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
0
by: Uwe Hoffmann | last post by:
Hi, i have used Pyrex to build some python Extensionclasses. Now i stumbled over the fact that if a subclass has a __hash__ method the __richcmp__ of the base is not called. # pseudocode ...
25
by: Martin Manns | last post by:
Hi, I am starting to use rationals and since I found no batteries included, I tried out the mxNumber package. However, I get strange warnings on comparison operations (which however seem to...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 385 open (+21) / 3790 closed (+21) / 4175 total (+42) Bugs : 1029 open (+43) / 6744 closed (+43) / 7773 total (+86) RFE : 262 open...
1
by: billiejoex | last post by:
Hi there, into a module of mine I 'warn' a message if a certain situation occurs: def add_anonymous_user(permissions=('r'): if 'w' in p: import warnings warnings.warn("it's not rencommended...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.