Hi everybody
I have a problem with my first test with pyairmore, my program
from ipaddress import IPv4Address
from pyairmore.request import AirmoreSession
from pyairmore.services.messaging import MessageRequestGSMError, MessagingService
ip = IPv4Address("192.168.0.145")
session = AirmoreSession(ip)
service = MessagingService(session)
PS C:\Users\Joseph\Desktop\Test Python> & C:/Users/Joseph/AppData/Local/Microsoft/WindowsApps/python3.10.exe "c:/Users/Joseph/Desktop/Test Python/Envoi.py"
Traceback (most recent call last):
File "c:\Users\Joseph\Desktop\Test Python\Envoi.py", line 10, in
service.send_message("+32xxxxxxxxx","Hello")
File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\services\messaging.py", line 107, in send_message
response = self.session.send(request)
File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\request__init__.py", line 157, in send
is_authorized = self.request_authorization()
File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\request__init.py", line 135, in request_authorization
response = self.send(request, False)
File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\request\init__.py", line 162, in send
return super().send(request, **kwargs)
File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 636, in send
kwargs.setdefault('proxies', self.rebuild_proxies(request, self.proxies))
File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 301, in rebuild_proxies
if 'Proxy-Authorization' in headers:
TypeError: argument of type 'NoneType' is not iterable
I have removed my phone number (xxxx) but it correct in my program.
In GoogleChrome all it's ok with the android phone
Thank you for your help and sorry for my English :-) ..
Joseph
Hi everybody I have a problem with my first test with pyairmore, my program
from ipaddress import IPv4Address from pyairmore.request import AirmoreSession from pyairmore.services.messaging import MessageRequestGSMError, MessagingService
ip = IPv4Address("192.168.0.145") session = AirmoreSession(ip) service = MessagingService(session)
try: service.send_message("+32xxxxxxxxx","Hello") except MessageRequestGSMError: print("Error")
But when I start is, I have this error :
PS C:\Users\Joseph\Desktop\Test Python> & C:/Users/Joseph/AppData/Local/Microsoft/WindowsApps/python3.10.exe "c:/Users/Joseph/Desktop/Test Python/Envoi.py" Traceback (most recent call last): File "c:\Users\Joseph\Desktop\Test Python\Envoi.py", line 10, in
service.send_message("+32xxxxxxxxx","Hello")
File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\services\messaging.py", line 107, in send_message
response = self.session.send(request) File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\request__init__.py", line 157, in send is_authorized = self.request_authorization() File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\request__init.py", line 135, in request_authorization response = self.send(request, False) File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pyairmore\request\init__.py", line 162, in send return super().send(request, **kwargs) File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 636, in send kwargs.setdefault('proxies', self.rebuild_proxies(request, self.proxies)) File "C:\Users\Joseph\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\requests\sessions.py", line 301, in rebuild_proxies if 'Proxy-Authorization' in headers: TypeError: argument of type 'NoneType' is not iterable
I have removed my phone number (xxxx) but it correct in my program. In GoogleChrome all it's ok with the android phone
Thank you for your help and sorry for my English :-) .. Joseph