Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

closes #2230

Args:
obj (:obj:`File handler`): An open file descriptor.
obj (:obj:`File handler` | :obj:`bytes`): An open file descriptor.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc string needs to be adapted.


@staticmethod
def is_file(obj: object) -> bool:
if isinstance(obj, bytes):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. It's not accurate that it's a file
What are the implications of reverting this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could make this check in parse_file_input instead. yeah, maybe the cleaner idea.

@Bibo-Joshi Bibo-Joshi requested a review from tsnoam December 3, 2020 20:29
@Bibo-Joshi
Copy link
Member Author

Tested sending files by (relative) local path in linux. Waiting for Pool to test on Windows, then we can merge.

# Conflicts:
#	telegram/files/inputmedia.py
# Conflicts:
#	telegram/files/inputmedia.py
@Bibo-Joshi Bibo-Joshi added this to the v13.2 milestone Dec 17, 2020
Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that looks good to me

@Poolitzer
Copy link
Member

Tested sending files by (relative) local path in windows, all good

@Bibo-Joshi Bibo-Joshi merged commit 80b3481 into master Dec 18, 2020
@Bibo-Joshi Bibo-Joshi deleted the fix-2230 branch December 18, 2020 10:20
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2020
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🔌 enhancement pr description: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Handle bytes input for files

4 participants