-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[BUG] Message.photo is set to an empty list when not provided #2606
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
Comments
Technically breaking (I guess?) and we want to do V14 changes now anyway, so on that list it goes |
@Poolitzer Similar for other attributes in I see this was introduced in #788 - I don't know if by @jsmnbom or by @Eldinnie . Do you recall what you meant by
? By this statement I would have expected to find Edit: We had some discussion in dev chat about this, see https://t.me/c/1494805131/17069 and answers |
Hi, is this issue still active? |
Hi @nivramam . IIRC we haven't made a final decision on this, which is why I didn't tag it for hacktoberfest. The reason why this was implemented in #788 was that e.g. Personally, I'd vote +0.5 on this, i.e. I'd be in on changing this but also wouldn't complain if it isn't changed. |
@Bibo-Joshi I think we should change it to None. I usually check my list before running a for loop on it. |
Yeah, maybe changing to None would be better |
I actually personally really like the argument that |
@nivramam I think we have a rather clear vote, then with +2/3. If you want to, you're welcome to PR for this issue :) |
@Bibo-Joshi Sure, would do. I've just started with contributing and learning on PRs, so a bit scratchy. Would definitely approach if I get stuck in between. As for now,we need to work changes on v14 right? |
Yes, switch to the v14 branch on your repo, and then base your working branch off of that one |
Hi, I performed the change (self.photo=None) in the telegram/message.py file and tested the same. The following is the output I got. Since I have just started out, I thought I can confirm here whether my track is right. While testing the change, the following "deprecated" message is coming, can anyone guide me as to how I need to check that? Thanks in advance |
This means that you're adding attributes to the |
OKay, let me check it then. Thanks |
Hey there. I am not modifying any I also checked if i have the latest version. I fetched upstream again and tried testing that change, which again gives this deprecated warning. What shall I do, can I proceed to create the PR? |
In the screenshot above it looks like you're working with some custom files. Maybe that's the problem. Make sure to edit the file |
Yeah, I have edited the |
Yes I went through the guide, but getting doubts as I do, sorry, that's why I'm approaching here.. |
Okay, then I don't understand what's going on and would need to see code. So, yeah, you can go ahead and PR and we'll have a look at what's going on :) |
Sure, thanks. |
test_message: test for updated change reg issue python-telegram-bot#2606 reply_keyboard_markup : ensure self.keyboard is not null before assigning to attributes
Closing for the reasons mentioned in #2741 (comment) and instead putting this on the todo list of #2633 |
Steps to reproduce
Generate a Message object without photo set.
Check the photo parameter
Expected behaviour
.photo should be None
Actual behaviour
.photo is an empty list
Wrong line:
python-telegram-bot/telegram/message.py
Line 515 in 1fdaaac
The text was updated successfully, but these errors were encountered: