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

It throws an exception when running on windows 10 cmd.exe after packed into an .exe script by pyinstaller command #270

Open
xiawenniu opened this issue Dec 10, 2023 · 1 comment

Comments

@xiawenniu
Copy link

OS: windows 10
python version: 3.12.0
package version: 0.15.293
pyinstaller version: 6.1.0

Description: I use pyinstaller to translate this python script to executable script on windows 10 and run it, but an exception is avoided below:

Exception ignored in: <function SMTP.del at 0x00000262924C8900>
Traceback (most recent call last):
File "yagmail\sender.py", line 261, in del
File "yagmail\sender.py", line 203, in close
TypeError: catching classes that do not inherit from BaseException is not allowed

Code like this :

yag = yagmail.SMTP(user=sender_account, password=sender_password, host=smtp_server)
try:
yag.send(to=row[EMAIL_INDEX_NAME], subject=subject, contents=content, attachments=
attachment_path)
time.sleep(30)
except BaseException as e:
print(e)

yagmail.SMTP.close

@xiawenniu
Copy link
Author

When running in python environment, it doesn't throw this exception.

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