473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 4089
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.