fiddler616
October 3rd, 2009, 04:48 PM
Hello,
I'm writing a program that involves repeatedly checking an email address. It executes successfully for a while, but then crashes:
No message right now! 196
No message right now! 197
No message right now! 198
No message right now! 199
Traceback (most recent call last):
File "wikiomatic.py", line 132, in <module>
message = getMessage()
File "wikiomatic.py", line 27, in getMessage
M.pass_("<password>")
File "/usr/lib/python2.6/poplib.py", line 189, in pass_
return self._shortcmd('PASS %s' % pswd)
File "/usr/lib/python2.6/poplib.py", line 152, in _shortcmd
return self._getresp()
File "/usr/lib/python2.6/poplib.py", line 128, in _getresp
raise error_proto(resp)
poplib.error_proto: -ERR [AUTH] Username and password not accepted.
I'm guessing that the problem is that I log in in the getMessage() function, which is repeated many times (199 in this case), and that Gmail throws a fit after a while. It's probably pretty bad for performance, too. I tried moving the authentication code outside of the function (making the POP3 object M global), but that raised a bunch of errors itself.
What should I do?
Thanks.
I'm writing a program that involves repeatedly checking an email address. It executes successfully for a while, but then crashes:
No message right now! 196
No message right now! 197
No message right now! 198
No message right now! 199
Traceback (most recent call last):
File "wikiomatic.py", line 132, in <module>
message = getMessage()
File "wikiomatic.py", line 27, in getMessage
M.pass_("<password>")
File "/usr/lib/python2.6/poplib.py", line 189, in pass_
return self._shortcmd('PASS %s' % pswd)
File "/usr/lib/python2.6/poplib.py", line 152, in _shortcmd
return self._getresp()
File "/usr/lib/python2.6/poplib.py", line 128, in _getresp
raise error_proto(resp)
poplib.error_proto: -ERR [AUTH] Username and password not accepted.
I'm guessing that the problem is that I log in in the getMessage() function, which is repeated many times (199 in this case), and that Gmail throws a fit after a while. It's probably pretty bad for performance, too. I tried moving the authentication code outside of the function (making the POP3 object M global), but that raised a bunch of errors itself.
What should I do?
Thanks.