NickWaterton / Roomba980-Python

Python program and library to control iRobot Roomba 980 Vacuum Cleaner
MIT License
361 stars 103 forks source link

Can't encode character #129

Open don-reba opened 1 month ago

don-reba commented 1 month ago

The scripts are unable to create config.ini. It looks like they are stumbling on Unicode characters in the vacuum's name.

[2024-06-02 14:10:38,085][ INFO](Roomba.Password     ) 0 robot(s) already defined in file./config.ini, found 1 robot(s) on network
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python\Lib\logging\__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
  File "C:\Python\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u1ea5' in position 112: character maps to <undefined>
Call stack:
  File ".\roomba.py", line 2424, in <module>
    main()
  File ".\roomba_direct.py", line 384, in main
    roombas = get_passwd.get_roombas()
  File ".\password.py", line 251, in get_roombas
    self.get_password()
  File ".\password.py", line 142, in get_password
    self.log.info("To add/update Your robot details,"
Message: 'To add/update Your robot details,make sure your robot (Trấn Xìn) at IP 10.0.0.88 is on the Home Base and powered on (green lights on). Then press and hold the HOME button on your robot until it plays a series of tones (about 2 seconds). Release the button and your robot will flash WIFI light.'
Arguments: ()
[2024-06-02 14:10:38,085][ INFO](Roomba.Password     ) To add/update Your robot details,make sure your robot (Trấn Xìn) at IP 10.0.0.88 is on the Home Base and powered on (green lights on). Then press and hold the HOME button on your robot until it plays a series of tones (about 2 seconds). Release the button and your robot will flash WIFI light.
Press <Enter> to continue...
s<Enter> to skip configuring this robot: dir
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python\Lib\logging\__init__.py", line 1163, in emit
    stream.write(msg + self.terminator)
  File "C:\Python\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u1ea5' in position 65: character maps to <undefined>
Call stack:
  File ".\roomba.py", line 2424, in <module>
    main()
  File ".\roomba_direct.py", line 384, in main
    roombas = get_passwd.get_roombas()
  File ".\password.py", line 251, in get_roombas
    self.get_password()
  File ".\password.py", line 159, in get_password
    self.log.info("Roomba ({}) IP address is: {}".format(robotname, addr))
Message: 'Roomba (Trấn Xìn) IP address is: 10.0.0.88'
Arguments: ()
[2024-06-02 14:10:50,322][ INFO](Roomba.Password     ) Roomba (Trấn Xìn) IP address is: 10.0.0.88
Traceback (most recent call last):
  File ".\roomba.py", line 2424, in <module>
    main()
  File ".\roomba_direct.py", line 384, in main
    roombas = get_passwd.get_roombas()
              ^^^^^^^^^^^^^^^^^^^^^^^^
  File ".\password.py", line 251, in get_roombas
    self.get_password()
  File ".\password.py", line 160, in get_password
    data = self.get_password_from_roomba(addr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".\password.py", line 196, in get_password_from_roomba
    wrappedSocket = context.wrap_socket(sock)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\ssl.py", line 455, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\ssl.py", line 970, in _create
    raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname