gpt4 book ai didi

python - 使用 pyramid_mailer 导致 ValueError : TPC in progress

转载 作者:太空宇宙 更新时间:2023-11-03 15:13:31 26 4
gpt4 key购买 nike

我在 Ubuntu Linux 服务器上运行 Pyramid ,在尝试使用 pyramid_mailer 时遇到了 ValueError。我的代码比较简单,似乎任何东西都会导致它:

def my_view(request):
mailer = get_mailer(request)
emailMessage = Message(subject="Welcome", sender="noreply@mysite.com", recipients = ["me@email.com"], body="test")
mailer.send(emailMessage)

导致此错误:

Traceback (most recent call last):
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/pyramid-1.5-py2.7.egg/pyramid/router.py", line 242, in __call__
response = self.invoke_subrequest(request, use_tweens=True)
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/pyramid-1.5-py2.7.egg/pyramid/router.py", line 217, in invoke_subrequest
response = handle_request(request)
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/pyramid_debugtoolbar-2.0.2-py2.7.egg/pyramid_debugtoolbar/toolbar.py", line 160, in toolbar_tween
return handler(request)
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/pyramid-1.5-py2.7.egg/pyramid/tweens.py", line 21, in excview_tween
response = handler(request)
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/pyramid_tm-0.7-py2.7.egg/pyramid_tm/__init__.py", line 79, in tm_tween
manager.abort()
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/transaction-1.4.3-py2.7.egg/transaction/_manager.py", line 116, in abort
return self.get().abort()
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/transaction-1.4.3-py2.7.egg/transaction/_transaction.py", line 468, in abort
reraise(t, v, tb)
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/transaction-1.4.3-py2.7.egg/transaction/_transaction.py", line 453, in abort
rm.abort(self)
File "/usr/share/nginx/wwwProj/local/lib/python2.7/site-packages/repoze.sendmail-4.2-py2.7.egg/repoze/sendmail/delivery.py", line 119, in abort
raise ValueError("TPC in progress")
ValueError: TPC in progress

我按照以下网站上的“入门(更简单的方法)”的说明进行操作:http://pyramid-mailer.readthedocs.org/en/latest/

最佳答案

这是一个 known issue .同时可以通过恢复到 repoze.sendmail 4.1(从 4.2 开始)来解决这个问题

关于python - 使用 pyramid_mailer 导致 ValueError : TPC in progress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23861277/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com