Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout #66

Open
Betristor opened this issue May 22, 2021 · 0 comments
Open

Timeout #66

Betristor opened this issue May 22, 2021 · 0 comments

Comments

@Betristor
Copy link

Hello,
Thank you for creating this project for getting notified. This works well on my laptop but when I try to get notified when my code runs on jupyter via email, this problem happened.

~/.local/lib/python3.7/site-packages/knockknock/email_sender.py in wrapper_sender(*args, **kwargs)
51 for i in range(len(recipient_emails)):
52 current_recipient = recipient_emails[i]
---> 53 yag_sender.send(current_recipient, 'Training has started 🎬', contents)
54 try:
55 value = func(*args, **kwargs)

~/.local/lib/python3.7/site-packages/yagmail/sender.py in send(self, to, subject, contents, attachments, cc, bcc, preview_only, headers, prettify_html, message_id, group_messages)
151 ):
152 """ Use this to send an email with gmail"""
--> 153 self.login()
154 recipients, msg_string = self.prepare_send(
155 to,

~/.local/lib/python3.7/site-packages/yagmail/sender.py in login(self)
204 self._login_oauth2(self.credentials)
205 else:
--> 206 self._login(self.credentials)
207
208 def _login(self, password):

~/.local/lib/python3.7/site-packages/yagmail/sender.py in _login(self, password)
211 connection to the SMTP server was closed by the user.
212 """
--> 213 self.smtp = self.connection(self.host, self.port, **self.kwargs)
214 self.smtp.set_debuglevel(self.debuglevel)
215 if self.starttls:

/opt/tljh/user/lib/python3.7/smtplib.py in init(self, host, port, local_hostname, keyfile, certfile, timeout, source_address, context)
1029 self.context = context
1030 SMTP.init(self, host, port, local_hostname, timeout,
-> 1031 source_address)
1032
1033 def _get_socket(self, host, port, timeout):

/opt/tljh/user/lib/python3.7/smtplib.py in init(self, host, port, local_hostname, timeout, source_address)
249
250 if host:
--> 251 (code, msg) = self.connect(host, port)
252 if code != 220:
253 self.close()

/opt/tljh/user/lib/python3.7/smtplib.py in connect(self, host, port, source_address)
334 if self.debuglevel > 0:
335 self._print_debug('connect:', (host, port))
--> 336 self.sock = self._get_socket(host, port, self.timeout)
337 self.file = None
338 (code, msg) = self.getreply()

/opt/tljh/user/lib/python3.7/smtplib.py in _get_socket(self, host, port, timeout)
1035 self._print_debug('connect:', (host, port))
1036 new_socket = socket.create_connection((host, port), timeout,
-> 1037 self.source_address)
1038 new_socket = self.context.wrap_socket(new_socket,
1039 server_hostname=self._host)

/opt/tljh/user/lib/python3.7/socket.py in create_connection(address, timeout, source_address)
726 if err is not None:
727 try:
--> 728 raise err
729 finally:
730 # Break explicitly a reference cycle

/opt/tljh/user/lib/python3.7/socket.py in create_connection(address, timeout, source_address)
714 if source_address:
715 sock.bind(source_address)
--> 716 sock.connect(sa)
717 # Break explicitly a reference cycle
718 err = None

I turned my new backup google account' safety option off as instruction offered on https://pypi.org/project/knockknock/ but this happened and search on this issue has no results, so here it goes.

My recipants_emails is firstly set to my private email which is not of gmail, after error above occured, I changed it to my previous google account and this time keyrings.alt dependency is needed but enve if this is satisfied the error occured again. Now I'm helpless.
Can anyone explain why this happened and how can I solve it?
Much thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant