Buon pomeriggio.

Ho un errore in questo script. Con Python 2 andava tutto bene, il 3.6.2 invece, si comporta in maniera diversa. Questo stralcio è la parte che si occupa di fare il login ad un server telnet.

***

login:' Gabrybat
test user Gabrybat <class 'str'>
Traceback (most recent call last):
  File "bici3.py", line 406, in <module>
    user, password = Apri("Nuovo", "")
  File "bici3.py", line 31, in Apri
    tn.write(user+"\r\n") # tn = telnetlib.Telnet()
File "C:\Users\GBattaglia\AppData\Local\Programs\Python\Python36-32\lib\telnetlib.py", line 287, in write
    if IAC in buffer:
TypeError: 'in <string>' requires string as left operand, not bytes

C:\Dropbox\Py>

Tuttavia io ho passato una stringa, ne ho anche stampato la classe nella riga "test user".

Qualcuno ha idea del perchè accada ciò?
Grazie.

Gabriele.
_______________________________________________
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python

Rispondere a