The Wayback Machine - https://web.archive.org/web/20201210055525/https://github.com/pyrogram/pyrogram/issues/357
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError: 'ascii' codec can't encode characters in position 1535-1542: ordinal not in range(128) #357

Open
itsecres-nandant opened this issue Jan 17, 2020 · 1 comment

Comments

@itsecres-nandant
Copy link

@itsecres-nandant itsecres-nandant commented Jan 17, 2020

Checklist

  • I am sure the error is coming from Pyrogram's code and not elsewhere.
  • I have searched in the issue tracker for similar bug reports, including closed ones.
  • I ran pip3 install -U https://github.com/pyrogram/pyrogram/archive/develop.zip and reproduced the issue using the latest development version.

Description

UnicodeEncodeError: 'ascii' codec can't encode characters in position 1535-1542: ordinal not in range(128)

Steps to Reproduce

from pyrogram import Client

api_id = 123456
api_hash = "0644dd76d7855e139941106b9f61e325"

with Client("abcdefg", api_id, api_hash) as app:
print(app.get_history("pyrogramchat"))

Traceback

Traceback (most recent call last):
File "test.py", line 7, in
print(app.get_history("pyrogramchat"))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1535-1542: ordinal not in range(128)

@delivrance
Copy link
Member

@delivrance delivrance commented Jan 19, 2020

@itsecres-nandant

  1. Format your code and make it look nicer.
  2. The steps that reproduce the issue are not good since get_history results may vary in time. You have to provide a reproducible example (if something is failing there it's likely because of a single message, find exactly that message).
  3. Your terminal is probably forcing python in ascii mode, you have to fix that in your terminal settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.