[Twisted-Python] UnicodeDecodeError with twisted.conch.ssh client

Henning.Ramm at mediapro-gmbh.de Henning.Ramm at mediapro-gmbh.de
Wed Nov 16 11:49:36 EST 2005

Hi there!

I get the following traceback while trying to connect to a server via conch.ssh:

--- * ---

starting service ssh-userauth

Traceback (most recent call last):
--- <exception caught here> ---
  File "D:\Python24\lib\site-packages\twisted\internet\selectreactor.py", line 139, in _doReadOrWrite
    why = getattr(selectable, method)()
  File "D:\Python24\lib\site-packages\twisted\internet\tcp.py", line 351, in doRead
    return self.protocol.dataReceived(data)
  File "D:\Python24\lib\site-packages\twisted\conch\ssh\transport.py", line 182, in dataReceived
  File "D:\Python24\lib\site-packages\twisted\conch\ssh\transport.py", line 591, in ssh_SERVICE_ACCEPT
  File "D:\Python24\lib\site-packages\twisted\conch\ssh\transport.py", line 219, in setService
  File "D:\Python24\lib\site-packages\twisted\conch\ssh\userauth.py", line 220, in serviceStarted
    self.askForAuth('none', '')
  File "D:\Python24\lib\site-packages\twisted\conch\ssh\userauth.py", line 224, in askForAuth
    self.transport.sendPacket(MSG_USERAUTH_REQUEST, NS(self.user) + \
  File "D:\Python24\lib\site-packages\twisted\conch\ssh\transport.py", line 107, in sendPacket
    packet = struct.pack('!LB', totalSize+lenPad-4, lenPad)+ \
  File "D:\Python24\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
exceptions.UnicodeDecodeError: 'utf8' codec can't decode bytes in position 2-3: invalid data

connection lost
Stopping factory <twisted.internet.protocol._InstanceFactory instance at 0x02D2B210>

--- * ---

I use password auth, and both user and password use only 7-bit ASCII chars.

It always happens on one machine, but works on another.
Both run a german Windows XP with Twisted 2.0, but this one has Python 2.4 and the other 2.3

Is it perhaps a known bug (and fixed in Twisted 2.1)?

Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept.

More information about the Twisted-Python mailing list