paramiko cannot send unicode strings to stdin of applicatons
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
paramiko |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The Problem occurs when doing
data=u"mööp!"
chan.
chan.
This crashes in paramiko/message.py in add_string, line 259:
return self
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1-2: ordinal not in range(128)
I guess its due to paramiko using cStringIO to internally store data.
from http://
"Unlike the StringIO module, this module is not able to accept Unicode strings that cannot be encoded as plain ASCII strings."
This leads to a problem when you want to store Unicode Strings:
import cStringIO
packet = cStringIO.
packet.
-------
UnicodeEncodeError Traceback (most recent call last)
<ipython-
----> 1 packet.
Am I missing something obvious like manually encoding the unicode to bytes?
Changed in paramiko: | |
status: | New → Invalid |
of _course_ I was missing something after 2 days without sleep:
data= u"mööp" .encode( 'utf-8' )
works.