os.mkdir(dir_name)
os.chdir(dir_name)
if not os.path.exists(dir_name):
os.mkdir(f"{dir_name}{random.randint(10000000, 999999999999)}")
os.chdir(dir_name)
Traceback (most recent call last):
File "main.py", line 127, in <module>
last_uid = get_emails(host, login, password, last_uid=last_uid)
File "main.py", line 52, in get_emails
os.chdir(dir_name)
FileNotFoundError: [Errno 2] No such file or directory: '1 от Максим Александрович ффф@yandex.ru'
Traceback (most recent call last):
File "main.py", line 127, in <module>
last_uid = get_emails(host, login, password, last_uid=last_uid)
File "main.py", line 52, in get_emails
os.chdir(dir_name)
FileNotFoundError: [Errno 2] No such file or directory: '2 от Максим Александрович ффф@yandex.ru'
import logging
logging.basicConfig(filename="sample.log", level=logging.INFO)
log = logging.getLogger("ex")
try:
raise RuntimeError
except RuntimeError:
log.exception("Error!")
Traceback (most recent call last):
File "main.py", line 138, in <module>
last_uid = get_emails(host, login, password, last_uid=last_uid)
File "main.py", line 62, in get_emails
os.mkdir(dir_name)
FileExistsError: [Errno 17] File exists: '1 от Максим Александрович ttt@yandex.ru'