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

GreenSSLSocket does not have a public constructor #550

Open
hehaorong opened this issue Feb 23, 2019 · 3 comments
Open

GreenSSLSocket does not have a public constructor #550

hehaorong opened this issue Feb 23, 2019 · 3 comments

Comments

@hehaorong
Copy link

Hey,
I send a email with celery, however, any exception like that:
GreenSSLSocket does not have a public constructor. Instances are returned by SSLContext.wrap_socket().
my code just is shown below:

@celery_app.task
def send_mail(to, subject=None, content=None):
import smtplib
from email.mime.text import MIMEText
sender = "admin@xxx.vip"
passwd = "xxx"
status = {'status': None, 'info': None}
try:
msg = MIMEText(content, 'plain', 'utf-8')
msg['Subject'] = subject
msg['From'] = sender
msg['TO'] = to

smtp = smtplib.SMTP_SSL('smtp.qq.com', 465)
smtp.login(sender, passwd)
smtp.sendmail(sender, to, msg.as_string())
status.update(status='ok', info='send email successfully.')
except (Exception, ) as e:
print(e)
status.update(status='fail', info='send email fail, more:%s' % (e.__str__()))
return status

celery command:
$ celery worker -A celeryconfig -l info -P eventlet

if celery work with gevent lib(with option '-P gevent'), it's works!

i wanna to know what can i do, if i use celery with eventlet.
pip list show eventlet's version is 0.24.1

@iROCKBUNNY
Copy link

iROCKBUNNY commented Mar 3, 2019

I have the same issue. This seems like a Python 3.7 compatibility issue and being fixed in the master branch. Either use Python 3.6 or the master branch.

#531

Maybe I just wait for the next stable release. Hope it comes sooner!

@dbanty
Copy link

dbanty commented Jun 21, 2019

I think this one was fixed in 0.25.0. Not completely sure because after updating I still suffer from #526

@Heidar-An
Copy link

I am also having the same issue while using flask-mail. My python version is 3.9.5

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

4 participants