PySMS icon indicating copy to clipboard operation
PySMS copied to clipboard

Error

Open kevo818 opened this issue 4 years ago • 3 comments

INFO:FMF:Authenticating FMF service INFO:FMF:Login succesful INFO:FMF:FMF service enabled on account INFO:FMF:Authenticating FMF service INFO:FMF:Login succesful INFO:FMF:FMF service enabled on account Traceback (most recent call last): File "C:\Users\kevo\Desktop\work\track.py", line 8, in ps = PySMS(address="[email protected]", password="PASSWORD", smtp_server="smtp.gmail.com", smtp_port="465", ssl=True) File "C:\Users\kevo\Desktop\work\PySMS.py", line 51, in init self.validate(address, password) File "C:\Users\kevo\Desktop\work\PySMS.py", line 165, in validate assert isinstance(address, basestring) NameError: name 'basestring' is not defined

This is the error i get when trying to run the file

also got this earlier

C:\Users\kevo\Desktop\work>python track.py INFO:FMF:Authenticating FMF service INFO:FMF:Login succesful INFO:FMF:FMF service enabled on account INFO:FMF:Authenticating FMF service INFO:FMF:Login succesful INFO:FMF:FMF service enabled on account Traceback (most recent call last): File "C:\Users\kevo\Desktop\work\track.py", line 8, in ps = PySMS(email="[email protected]", password="PASSWORD", smtp_server="smtp.gmail.com", smtp_port="465", ssl=True) TypeError: init() got an unexpected keyword argument 'email'

however i changed email to address and it worked. still need help with the first error tho

kevo818 avatar Mar 04 '21 23:03 kevo818

Hi @kevo818, please change your password for [email protected] IMMEDIATELY as well as any other accounts that use that password if that was truly the password for your gmail account (I sincerely hope not) and de-auth any active sessions for that gmail account as you effectively just posted your password for that account. In the future, when copying pasting code to public resources please make sure that you scrub any credentials and personally identifiable information in general.

In regards to the issue, this code was written a while back with python 2.7 and from your error it seems like you're using python 3 which dropped support for basestring. I have not worked on this code in a while but you can change lines #165 and 166 in PySMS.py to the following to fix the immediate error link:

assert isinstance(address, str)
assert isinstance(password, str)

Alternatively, you can switch to using python 2.7 instead to fix the issue.

clayshieh avatar Mar 05 '21 00:03 clayshieh

haha, thats my gmail for all my smtp projects, i dont really care about it to much. Thanks for the lookout tho! also, i got a new error.

File "C:\Users\kevo\Desktop\work\track.py", line 8, in ps = PySMS(address="....", password="....", smtp_server="smtp.gmail.com", smtp_port="465", ssl=True) File "C:\Users\kevo\Desktop\work\PySMS.py", line 93, in init self.init_server() File "C:\Users\kevo\Desktop\work\PySMS.py", line 196, in init_server self.smtp.login(self.address, self.password) File "C:\Users\kevo\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 723, in login (code, resp) = self.auth( File "C:\Users\kevo\AppData\Local\Programs\Python\Python39\lib\smtplib.py", line 634, in auth response = encode_base64(initial_response.encode('ascii'), eol='') AttributeError: 'bytes' object has no attribute 'encode'

new error boss

kevo818 avatar Mar 05 '21 02:03 kevo818

anyway you could show me how to integrate your FMF api with twlio? I have a free trial id like to use it for something.

kevo818 avatar Mar 05 '21 03:03 kevo818