Open prajna-pranab opened 11 years ago
Do you know what is causing this issue yet?
We can enable Skype API log traces so you can see the communication between Skype and Skype4Py?
I believe it is just an error in the expected reply, Mikko. Generally the API strips off the word at the front of the command (SET or GET) and returns the rest of the command (unless I read that wrong in the api docs). In the case of AddMembers() it only returns ALTER CHAT ADDMEMBERS but the skype4py code uses startsWith(expected) and raises the exception. Thats how it seems to me. I thought that changing the 'expected' text might fix it but addmembers is only one of a number of ALTER commands and the others may send the expected replies ok.
The api is returning the correct string, according to the docs. It seems that skype4py is expecting it to return the chat ID embedded in the response string, but the api doesn't.
Good!
So, to try a fix on this:
Install the package in-place using virtualenv: http://opensourcehacker.com/2012/09/16/recommended-way-for-sudo-free-installation-of-python-software-with-virtualenv/
python setup.py develop # Will activate package in-place development
Hopefully this gets us started towards the fix :)
Hi Mikko, I have identified the problem and found a solution and am about to test it. It seems that for most of the ALTER commands the API responds by echoing the command, including the call_id, voicemail_id etc. For some strange reason this convention is departed from with the ALTER CHAT commands, where the command is echoed without the chat_id. Thus it is simple to fix by just removing the self.Name argument from the expected reply string in chat.py's _Alter method.
The modification needed is in chat.py at line 20 in _Alter()
change from: return self._Owner._Alter('CHAT', self.Name, AlterName, Args, 'ALTER CHAT %s %s' % (self.Name, AlterName)) change to: return self._Owner._Alter('CHAT', self.Name, AlterName, Args, 'ALTER CHAT %s' % (AlterName))
This corrects the exception I was receiving when adding members to a chat group. The rationale is explained above.
I would be very pleased if someone could incorporate this fix, since I am unfamiliar with git and it would require some time for me to work out how to commit my changes back to my fork and have them merged back.
regards, Prajna
Hi @prajna-pranab
All patches go through the following process:
If you need any clarifications please ask me
When calling chat.AddMembers(user) the following exception is raised:
SkypeError: [Errno 0] Unexpected reply from Skype, got [ALTER CHAT ADDMEMBERS], expected [ALTER CHAT #messageId ADDMEMBERS (...)]
I have replaced the actual message Id with #messageId in the exception text above.
It appears that the skype api doesn't return the message id in the response message or if it does it returns it after the ALTER CHAT ADDMEMBERS text.
I'm using skype4py inside a web2py application on ubuntu 12.04. I'm using the X11 transport because dBus reports an error the second time the app is run. I'll post that as a separate issue.
Thanks for the pointer to here Mikko.