python-ami icon indicating copy to clipboard operation
python-ami copied to clipboard

dont work with python 3.8

Open drewer opened this issue 3 years ago • 9 comments

module 're' has no attribute '_pattern_type'

drewer avatar Jul 22 '21 10:07 drewer

I just encountered this issue. Looks like its fixed in the master but not in the pip package

marrold avatar Jul 24 '21 00:07 marrold

Yeah, it looks like that I forgot to release this fix

ettoreleandrotognoli avatar Jul 24 '21 00:07 ettoreleandrotognoli

https://pypi.org/project/asterisk-ami/0.1.6/

ettoreleandrotognoli avatar Jul 24 '21 00:07 ettoreleandrotognoli

Just a heads up, there might be a bug in the latest release. The AMI is disconnecting but If I roll back to the previous release it works fine.

Something is firing the disconnect here - https://github.com/ettoreleandrotognoli/python-ami/blob/00fbaa2b59060d78937af934aabca3241ae4c2be/asterisk/ami/client.py#L186

I will try and troubleshoot some more tomorrow

Thanks!

marrold avatar Jul 24 '21 00:07 marrold

Replicated with this simple script taken from the example - https://gist.github.com/marrold/8c4cf1b7c89dc3935626f5ab85d4cd0f

After a few seconds I get The AMI has disconnected: None

Looking at the actual messages to the AMI, it randomly tries to login in again despite a ping response, then finally gives up - https://gist.github.com/marrold/652ca6afc0a1d551332cdbff6cae2099

marrold avatar Jul 24 '21 01:07 marrold

I reverted this commit and now it works - https://github.com/ettoreleandrotognoli/python-ami/commit/8bed899ca170feb0abddf0e3105c8ffe8c5d0903

But unfortunatly I don't know why that's causing the issue.

@jowrjowr do you recall why you made this change? Do you know why it would cause this issue? Thanks!

marrold avatar Jul 24 '21 17:07 marrold

All I can remember is what I put in as the commit reason, and that seems pretty self-explanatory.

As I recall, connections would time out but never fail and that was causing issues with some scripting around a client's Asterisk I was working with at the time. Haven't touched this stuff since so I have no recent insight.

jowrjowr avatar Jul 24 '21 19:07 jowrjowr

Okay, thanks for the info

marrold avatar Jul 24 '21 21:07 marrold

I think this might be an issue on my side, I'll continue to investigate.

marrold avatar Jul 25 '21 16:07 marrold