mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 21:03:45 +03:00
Fix .start() failing on some terminals
This commit is contained in:
parent
5fd6155168
commit
8e01946957
|
@ -356,7 +356,14 @@ class TelegramClient(TelegramBareClient):
|
|||
me = self.sign_in(phone=phone, password=password)
|
||||
|
||||
# We won't reach here if any step failed (exit by exception)
|
||||
print('Signed in successfully as', utils.get_display_name(me))
|
||||
signed, name = 'Signed in successfully as', utils.get_display_name(me)
|
||||
try:
|
||||
print(signed, name)
|
||||
except UnicodeEncodeError:
|
||||
# Some terminals don't support certain characters
|
||||
print(signed, name.encode('utf-8', errors='ignore')
|
||||
.decode('ascii', errors='ignore'))
|
||||
|
||||
self._check_events_pending_resolve()
|
||||
return self
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user