Closed nickolas1969 closed 8 years ago
Got it working by modifying "/usr/lib64/python3.4/site-packages/paramikoe.py"
here is what I changed:
130: buffer = buffer.replace(b'\r', b'') # (Added the b's) 135: sys.stdout.write(buffer.decode()) # Added .decode() 139: self.current_output += buffer.decode() # Added the .decode()
There are more spots that use the Python 2.x format, but my Python Programs have not hit them, so I won't change anything further until they do.
So what ever method pip/github installer used to build both my python 2.7 and 3.4 target versions, 3.4 did not catch this?
Thanks for all your help. I'll take into account everything you mentioned and look at getting a Python 3.x compatible out soon.
Cheers Fotis
Any progress on this? :)
Having a Python 3.4 conversion issue that I can't seem to solve:
prompt = 'router#' interact.expect(prompt)
Throws:
Traceback (most recent call last): File "./ssh-expect.py", line 37, in
interact.expect(prompt)
File "/usr/lib64/python3.4/site-packages/paramikoe.py", line 130, in expect
buffer = buffer.replace('\r', '')
TypeError: 'str' does not support the buffer interface
Which I see a lot in other code I write where using .decode('UTF-8') and .encode('UTF-8') get's me though, but in this case I get.
File "/usr/lib64/python3.4/site-packages/paramikoe.py", line 116, in expect for re_string in re_strings File "/usr/lib64/python3.4/site-packages/paramikoe.py", line 117, in
if re.match('.*\n' + re_string + '$',
TypeError: Can't convert 'int' object to str implicitly
Is there a method for Python 3.x for this module? :-D