Python script cuts off early

I wasn't sure if this should go in the networking board or not, since I am trying to log into routers, however I don't think my script issues have anything to do with the routers themselves....
I am trying to write a script that will log into various routers we have on the network and determine what type it is. My script can successfully log into a router and start running commands.

What I don't know is why it stops early in the middle of what it is capturing.

I get logged into the router, then run a "show version" command, which then is waiting for output. What the python script receives/sees is:

It cuts off here in the middle of the text and the script stops (no error messages or exceptions), and never gets to the portion that contains what is "expecting"

Here is an example of what it is SUPPOSED to capture, you can see it's a lot more info:

So here is a snippet of my code, we are using python 2.4.3 with pexpect module

fout = file("pylog.log", 'w')

li = pexpect.spawn ('ssh ' + user + '@' + router) 
li.logfile = fout
pw = li.expect (['yes/no', 'assword:'])
if pw==0:
        li.sendline ('yes')
if pw==1:
        li.sendline (psswd)
li.expect (router + '#')
li.sendline ("term len 0")
li.expect (router + '#')
li.sendline ("show ver")  
#li.expect (pexpect.EOF) 
print li.before    

time.sleep(1.0)   
type = li.expect (['WS-C6509', 'Operating', 'IOS', pexpect.TIMEOUT, pexpect.EOF])
if type==0:
        print ("Model is 6500")
#if type==1:
#       print ("Match 1st line")
if type==2:
        print ("2nd line")
if type==3:
        print 'No match, timed out'

The pyexpect module tends to be a bit buggy. It looks like you can connect to the router using SSH. The paramiko module is tailor-made for performing SSH functions.

Thanks but Paramiko requires python 2.5, and I am running 2.4