ettoreleandrotognoli / python-ami

Python AMI Client
BSD 3-Clause "New" or "Revised" License
107 stars 66 forks source link

dont work with python 3.8 #44

Open drewer opened 3 years ago

drewer commented 3 years ago

module 're' has no attribute '_pattern_type'

marrold commented 3 years ago

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

ettoreleandrotognoli commented 3 years ago

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

ettoreleandrotognoli commented 3 years ago

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

marrold commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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!

jowrjowr commented 3 years ago

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.

marrold commented 3 years ago

Okay, thanks for the info

marrold commented 3 years ago

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