From 087970bca8ed71b994b795acf3e473562cb3e3c1 Mon Sep 17 00:00:00 2001 From: Cornelius Mosch <16503500+cmaxl@users.noreply.github.com> Date: Mon, 28 Jul 2025 05:25:32 +0200 Subject: [PATCH] replace os.getlogin() with getpass.getuser() (#9928) --- esphome/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/__main__.py b/esphome/__main__.py index c9f5037890..341c1fa893 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -2,6 +2,7 @@ import argparse from datetime import datetime import functools +import getpass import importlib import logging import os @@ -335,7 +336,7 @@ def check_permissions(port): raise EsphomeError( "You do not have read or write permission on the selected serial port. " "To resolve this issue, you can add your user to the dialout group " - f"by running the following command: sudo usermod -a -G dialout {os.getlogin()}. " + f"by running the following command: sudo usermod -a -G dialout {getpass.getuser()}. " "You will need to log out & back in or reboot to activate the new group access." )