[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Juan Gonzalez
Juan Gonzalez added the comment: I print 1 before the faulty line and like Jesús says I'm surprised I get a 1 Description: Build passed 1 Traceback (most recent call last): File "wtfibmdom", line 23, in if url.find(str) > 0: AttributeError: 'int' object has no attribute 'find' -

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Brian Curtin
Changes by Brian Curtin : -- stage: -> committed/rejected status: open -> closed type: crash -> behavior ___ Python tracker ___ ___ P

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Put the failing code inside a "try", and wrote in the "except": "print repr(url)". I am pretty sure your "url" can be, actually, a number. Or print "url" just before the 'faulty' line. I guess you will be surprised. -- __

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Brian Curtin
Brian Curtin added the comment: Can you post some example code or a test case? -- nosy: +brian.curtin ___ Python tracker ___ ___ Pyth

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Juan Gonzalez
Juan Gonzalez added the comment: Hi Georg, This is the python code listing: from RSS import ns, CollectionChannel, TrackingChannel #Create a tracking channel, which is a data structure that #Indexes RSS data by item URL tc = TrackingChannel() str = 'j3-nspire-prd-validation' index = 0 #Return

[issue12492] Inconsistent Python find() behavior

2011-07-05 Thread Juan Gonzalez
Juan Gonzalez added the comment: Today I tried to use parse() instead of find() and I found out the following response: tony@ubuntu:~/auto/sel/scripts$ python wtfibmdom Traceback (most recent call last): File "wtfibmdom", line 22, in if url.parse(str) > 0: AttributeError: 'str' object

[issue12492] Inconsistent Python find() behavior

2011-07-04 Thread Georg Brandl
Georg Brandl added the comment: I suspect this is a problem where "url" is reassigned to an integer somewhere in code that isn't shown to us. Please post the whole function and the whole traceback if you still think this is a valid bug. -- nosy: +georg.brandl resolution: -> invalid

[issue12492] Inconsistent Python find() behavior

2011-07-04 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Note, anyway, that your python is not a real release. where is it coming from?. -- ___ Python tracker ___

[issue12492] Inconsistent Python find() behavior

2011-07-04 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: Python 2.7.2 (default, Jun 16 2011, 01:46:46) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> "hola".find("q") > 0 False >>> "hola".find("q") < 0 True I don't see the problem. Please, send a complete testcase.

[issue12492] Inconsistent Python find() behavior

2011-07-04 Thread Juan Gonzalez
New submission from Juan Gonzalez : Something really weird going on in python find() string function. When I call .find() and python returns -1 it crashes when compared against 0 using the ">" operator. The statement in which crash condition occurs is the following: if url.find(str) > 0: