0

In process of making a bot for Telegram. In PyCharm no problems. All code works and no errors. But when I use CMD, this:


2017-08-12 22:40:27.411036
2017-08-12 22:40:27,412 (util.py:64 WorkerThread2) ERROR - TeleBot: "UnicodeEncodeError occurred, args=('charmap', 'SMS from \u304d\u3064\u307f None. (id = 170683344) \r\n Text - s', 9, 12, 'character maps to <undefined>')
Traceback (most recent call last):
  File "C:\Python\Python35\lib\site-packages\telebot\util.py", line 58, in run
    task(*args, **kwargs)
  File "main.py", line 57, in handle_text
    log(message, answer)
  File "main.py", line 29, in log
    message.text))
  File "C:\Python\Python35\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 9-11: character maps to <undefined>
"
Traceback (most recent call last):
  File "main.py", line 61, in <module>
    bot.polling(none_stop=True, interval=0)
  File "C:\Python\Python35\lib\site-packages\telebot\__init__.py", line 264, in polling
    self.__threaded_polling(none_stop, interval, timeout)
  File "C:\Python\Python35\lib\site-packages\telebot\__init__.py", line 288, in __threaded_polling
    self.worker_pool.raise_exceptions()
  File "C:\Python\Python35\lib\site-packages\telebot\util.py", line 107, in raise_exceptions
    six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
  File "C:\Python\Python35\lib\site-packages\six.py", line 686, in reraise
    raise value
  File "C:\Python\Python35\lib\site-packages\telebot\util.py", line 58, in run
    task(*args, **kwargs)
  File "main.py", line 57, in handle_text
    log(message, answer)
  File "main.py", line 29, in log
    message.text))
  File "C:\Python\Python35\lib\encodings\cp437.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 9-11: character maps to <undefined>

(2 first lines - right algorithm) I am in the right location and start the right file. No problems with it

Cory Madden
  • 5,026
  • 24
  • 37

0 Answers0