Infinite loop during reading a file in python
<p>I have a file with a list of words and I am trying to look for a word reading line by line. A sample of common_words file would be: </p>

<pre><code>yourself
yourselves
z
zero
</code></pre>

<p>The list is lexicographically sorted. </p>

<pre><code>def isCommonWord(word):

    commonWordList = open("common_words", 'r')
    commonWord = commonWordList.readline()
    commonWord = commonWord.rstrip("\n")

    while commonWord &lt;= word:
        if commonWord == word:
            return True 
        commonWord =  commonWordList.readline()
        commonWord = commonWord.rstrip("\n")

    return False

if isCommonWord("zeros"):
    print "true"
else:
    print "false"
</code></pre>

<p>Now this function is getting into an infinite loop. I have no idea how this is happening. Any help will be greatly appreciated. <strong>If I try other variables besides "zeros" then it works perfectly fine. Only with the "zeros" I am facing trouble.</strong> Thank you for your time. </p>
