We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
receiver.py crash on recieved message
2.7.5
0.4.10
Linux centos 3.10.0-229.4.2.el7.x86_64 #1 SMP Wed May 13 10:06:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
sample from github:
from __future__ import unicode_literals import logging logging.basicConfig(level=logging.DEBUG) from pytg import Telegram tg = Telegram( telegram="/usr/bin/telegram-cli", pubkey_file="/etc/tg-server.pub") receiver = tg.receiver sender = tg.sender receiver = tg.receiver from pytg.utils import coroutine def main_loop(): while not QUIT: msg = (yield) # it waits until it got a message, stored now in msg. print("Message: ", msg.text) # # receiver.start() receiver.message(main_loop())
display received message
crash with
INFO:pytg:Starting Telegram Executable: "/usr/bin/telegram-cli -R -W -P 4458 -k /etc/tg-server.pub --json --permanent-peer-ids --permanent-peer-ids" DEBUG:pytg.sender:Parsing raw: Argument help - <command> (needed) DEBUG:pytg.sender:Sending command >[disable_preview] help < INFO:pytg:CLI did not responde. change_user_group: can't find the user telegramd to switch to DEBUG:pytg.sender:Parsing raw: Argument help - <command> (needed) DEBUG:pytg.sender:Sending command >[disable_preview] help < DEBUG:pytg.sender:Socket Connected. DEBUG:pytg.sender:All Sent. INFO:pytg:CLI available. DEBUG:pytg.receiver:Socket Connected. DEBUG:pytg.receiver:CLI session registered. DEBUG:pytg.receiver:Hit end. DEBUG:pytg.receiver:Received Message: {"user": {"id": "$xxxxxxxxxxxxxxxxxxxxxxx", "first_name": "xxxxxxxxxxxxxxxxxxxxxxx", "username": "xxxxxxxxxxxxxxxxxxxxxxx", "peer_type": "user", "last_name": "xxxxxxxxxxxxxxxxxxxxxxx", "flags": 589825, "peer_id": xxxxxxxxxxxxxxxxxxxxxxx, "print_name": "xxxxxxxxxxxxxxxxxxxxxxx", "phone": "xxxxxxxxxxxxxxxxxxxxxxx"}, "online": true, "when": "2017-03-17 13:30:34", "state": 1, "event": "online-status"} DEBUG:pytg.receiver:Received Message: "{"user": {"id": "$xxxxxxxxxxxxxxxxxxxxxxx", "first_name": "xxxxxxxxxxxxxxxxxxxxxxx", "username": "xxxxxxxxxxxxxxxxxxxxxxx", "peer_type": "user", "last_name": "xxxxxxxxxxxxxxxxxxxxxxx", "flags": 589825, "peer_id": xxxxxxxxxxxxxxxxxxxxxxx, "print_name": "xxxxxxxxxxxxxxxxxxxxxxx", "phone": "xxxxxxxxxxxxxxxxxxxxxxx"}, "online": true, "when": "2017-03-17 13:30:34", "state": 1, "event": "online-status"}" DEBUG:pytg.receiver:Hit end. DEBUG:pytg.receiver:skipping second linebreak. DEBUG:pytg.receiver:Messages waiting in queue: 0 **Traceback (most recent call last): File "telegram.py", line 30, in <module> receiver.message(main_loop()) File "/opt/pytg/pytg/utils.py", line 29, in start cr = func(*args, **kwargs) File "/opt/pytg/pytg/receiver.py", line 212, in message function.send(message) TypeError: can't send non-None value to a just-started generator** INFO:pytg.sender:Quit Sending. Not allowing sending anymore. WARNING:pytg.sender:Terminating currently sending request. INFO:pytg.sender:Currently not Sending. INFO:pytg:Closing Connections. DEBUG:pytg:Closing sender. DEBUG:pytg.sender:Already did quit Sending. Not allowing sending. WARNING:pytg.sender:Terminating currently sending request. INFO:pytg.sender:Currently not Sending. DEBUG:pytg:Closing sender. DEBUG:pytg.receiver:receiver thread existing: True INFO:pytg:Asking to CLI to stop. DEBUG:pytg:Sender already stopped. Unable to issue safe_quit or quit to exit via socket. Exception in thread Receiver (pytg): Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 764, in run self.__target(*self.__args, **self.__kwargs) File "/opt/pytg/pytg/receiver.py", line 125, in _receiver raise ConnectionError("Remote end closed.") ConnectionError: Remote end closed. INFO:pytg:CLI did stop (0). DEBUG:pytg.sender:Already did quit Sending. Not allowing sending.
if i comment out function.send(message) line from receiver.py it works without problem. I can see incoming messages in debug log.
The text was updated successfully, but these errors were encountered:
The line change_user_group: can't find the user telegramd to switch to is strange. There is no part on pytg side which does that...
change_user_group: can't find the user telegramd to switch to
pytg
Sorry, something went wrong.
This seems related to #81
No branches or pull requests
The problem
receiver.py crash on recieved message
Your environment
2.7.5
0.4.10
Linux centos 3.10.0-229.4.2.el7.x86_64 #1 SMP Wed May 13 10:06:09 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Steps to reproduce
sample from github:
Expected behaviour
display received message
Actual behaviour
crash with
if i comment out function.send(message) line from receiver.py it works without problem. I can see incoming messages in debug log.
The text was updated successfully, but these errors were encountered: