Sitelet https://web.archive.org/web/20240120111842/https://github.com/pyrogram/pyrogram/pull/985
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

Fix write method missing in pyrogram.raw.core.List #985

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

01101sam
Copy link
Contributor

@01101sam 01101sam commented May 2, 2022 •

Description

This is a temporary workaround for the method pyrogram.raw.core.List
The write method can be called by RpcResult and when the query is GetDialogFilters (Which the result is empty by default)
The error will be TypeError: 'NoneType' does not support the buffer interface

Steps to reproduce

For error:

from io import BytesIO
b = BytesIO()
b.write(None)
# > TypeError: 'NoneType' does not support the buffer interface

What actually happened:

# RpcResult > write()
b.write(self.result.write())  # Where self.result is a pyrogram.raw.core.List([])

When pyrogram.raw.core.List.write is called, it will call TLObject.write (class List(TList[Any], TLObject):), but it will return a None type since it's a empty function


The reason I opened this PR is to ask is there any other workaround, the code quality of this looks bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant