Has anyone tried using Python's 2to3 program to convert Pexpect to Python3?

181 views
Skip to first unread message

LouieInSeattle

unread,
Sep 9, 2011, 7:24:03 PM9/9/11
to winpexpect
I ran Python's 2to3 program on Pexpect, and got tons of changes, but I
am getting a weird error when I try to login to a linux SSH. It comes
up with an OpenSSH login screen, asking for the password, but the
password is supposed to be passed in via a hard-coded variable (for
testing only), but something is ignoring the password.

I haven't been able to pinpoint the problem using Eclipse's debug
feature, and when googling the problem found this thread.

Any ideas?

-- Louie

P.S. When I get a failed login, I also get six error messages that say
"Could not grab the keyboard. A malicious client may be eavesdropping
on your session." This didn't come up until after I ran the 2to3
conversion program on Pexpect.

brea...@magma.ca

unread,
Feb 4, 2013, 2:15:31 PM2/4/13
to winpe...@googlegroups.com
Hi Louie: I used /python/Tools/Scripts/2to3.py to convert both pexpect.py and winpexpect.py, and could then import both modules without error. The setup.py script tries to do the conversion, but gets errors, possibly due to the fix_types setting. Also, the setuptools I got from the net for Python V3 is requesting more testing, so this is another uncertainty.

When I started running scripts, I got run time errors and made some changes to pexpect.py so that winpexpect.py would work:

C:\Python33\Lib\site-packages>diff pexpect.py.bak pexpect.py
1220c1220
<             if type(p) in str:
---
>             if type(p) is str:
1781,1782c1781,1782
<     #pathlist = p.split (os.pathsep)
<     pathlist = string.split (p, os.pathsep)
---
>     pathlist = p.split (os.pathsep)
>     # pathlist = string.split (p, os.pathsep)

Reply all
Reply to author
Forward
0 new messages