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

Error when TG File Doesnot Have Filename #82

Closed
yasirarism opened this issue Nov 27, 2022 · 2 comments
Closed

Error when TG File Doesnot Have Filename #82

yasirarism opened this issue Nov 27, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@yasirarism
Copy link

When TG File doesnot have filename, bot will got error like this. How to fix it?

2022-11-27T13:55:38.306946+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 886, in quote_plus
2022-11-27T13:55:38.306947+00:00 app[web.1]:     string = quote(string, safe + space, encoding, errors)
2022-11-27T13:55:38.306947+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 870, in quote
2022-11-27T13:55:38.306947+00:00 app[web.1]:     return quote_from_bytes(string, safe)
2022-11-27T13:55:38.306948+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 895, in quote_from_bytes
2022-11-27T13:55:38.306948+00:00 app[web.1]:     raise TypeError("quote_from_bytes() expected bytes")
2022-11-27T13:55:38.306948+00:00 app[web.1]: TypeError: quote_from_bytes() expected bytes
@EverythingSuckz
Copy link
Owner

When TG File doesnot have filename, bot will got error like this. How to fix it?

2022-11-27T13:55:38.306946+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 886, in quote_plus
2022-11-27T13:55:38.306947+00:00 app[web.1]:     string = quote(string, safe + space, encoding, errors)
2022-11-27T13:55:38.306947+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 870, in quote
2022-11-27T13:55:38.306947+00:00 app[web.1]:     return quote_from_bytes(string, safe)
2022-11-27T13:55:38.306948+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 895, in quote_from_bytes
2022-11-27T13:55:38.306948+00:00 app[web.1]:     raise TypeError("quote_from_bytes() expected bytes")
2022-11-27T13:55:38.306948+00:00 app[web.1]: TypeError: quote_from_bytes() expected bytes

@yasirarism Are you on the latest commit? also send full logs of possible

@eyMarv
Copy link
Collaborator

eyMarv commented Dec 12, 2022

When TG File doesnot have filename, bot will got error like this. How to fix it?

2022-11-27T13:55:38.306946+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 886, in quote_plus
2022-11-27T13:55:38.306947+00:00 app[web.1]:     string = quote(string, safe + space, encoding, errors)
2022-11-27T13:55:38.306947+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 870, in quote
2022-11-27T13:55:38.306947+00:00 app[web.1]:     return quote_from_bytes(string, safe)
2022-11-27T13:55:38.306948+00:00 app[web.1]:   File "/app/.heroku/python/lib/python3.10/urllib/parse.py", line 895, in quote_from_bytes
2022-11-27T13:55:38.306948+00:00 app[web.1]:     raise TypeError("quote_from_bytes() expected bytes")
2022-11-27T13:55:38.306948+00:00 app[web.1]: TypeError: quote_from_bytes() expected bytes

@yasirarism Are you on the latest commit? also send full logs of possible

Yes latest commit
Just make it
if filename:
name = quote_plus(filename)
else:
name = None

@EverythingSuckz EverythingSuckz added the inspecting Currently looking into this issue label Dec 28, 2022
@EverythingSuckz EverythingSuckz added bug Something isn't working and removed inspecting Currently looking into this issue labels Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants