New submission from Juan Gonzalez <juan.gonza...@ti.com>:

Something really weird going on in python find() string function.  When I call 
<string>.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:
        print "RSS Item:", url
        break; 

However, if I change the statement to be "<" instead it does not crash.
The error that the python compiler reports is:

AttributeError: 'int' object has no attribute 'find'

My version of python is:

tony@ubuntu:~/auto/sel/scripts$ python -V
Python 2.7.1+

----------
components: Regular Expressions
messages: 139810
nosy: juan.gonzalez
priority: normal
severity: normal
status: open
title: Inconsistent Python find() behavior
type: crash
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12492>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to