[FIX] codepage in new console launch

This commit is contained in:
Benedek Racz 2020-02-22 17:05:01 +01:00
parent e7f58cc2fc
commit bbc6a4f16c
5 changed files with 11 additions and 5 deletions

2
.gitignore vendored
View File

@ -2,6 +2,8 @@
__pycache__/ __pycache__/
*.py[cod] *.py[cod]
*coverage.xml
# C extensions # C extensions
*.so *.so

View File

@ -12,9 +12,12 @@ environment:
secure: CcyBI8e/2LdIT2aYIytTAgR4795DNBDM/ztsz1kqZYYOeNc3zlJWLdYWrnjCHn5W6/ZcAHrsxCdCMHvtr6PIVgBRpl2RR3fk2jKTzKqJJsLW871q30BsE0kws32f1IiqfjVtLn8BUC91IJ2xBBXtOYktf1tCMi3zJMSF9+MIOQKIu298bIRnD1Lc+4lzcSZJOn4I7dOMdzlcCMRqhtO58TGwR/hD+22FHjyWVB8nLL18AO+XXS9lHSOUrH6rD5NYvVFZD68oV/RrCGAjRmfMnw== secure: CcyBI8e/2LdIT2aYIytTAgR4795DNBDM/ztsz1kqZYYOeNc3zlJWLdYWrnjCHn5W6/ZcAHrsxCdCMHvtr6PIVgBRpl2RR3fk2jKTzKqJJsLW871q30BsE0kws32f1IiqfjVtLn8BUC91IJ2xBBXtOYktf1tCMi3zJMSF9+MIOQKIu298bIRnD1Lc+4lzcSZJOn4I7dOMdzlcCMRqhtO58TGwR/hD+22FHjyWVB8nLL18AO+XXS9lHSOUrH6rD5NYvVFZD68oV/RrCGAjRmfMnw==
# Set default pytohn, the real matrinx is in the tox settings. # Set default pytohn, the real matrinx is in the tox settings.
matrix: matrix:
- PYTHON: "C:\\Python36" - TOXENV: py37-default
PYTHON_VERSION: 3.6 PYTHON: "C:\\Python37"
PYTHON_ARCH: 32 - TOXENV: py37-legacy_wexpect
PYTHON: "C:\\Python37"
- TOXENV: py37-spawn_pipe
PYTHON: "C:\\Python37"
build: off build: off

View File

@ -36,6 +36,7 @@ def main():
parser.add_argument('--local_echo', type=str, help='Echo sent characters', default=True) parser.add_argument('--local_echo', type=str, help='Echo sent characters', default=True)
parser.add_argument('--interact', type=str, help='Show console window', default=False) parser.add_argument('--interact', type=str, help='Show console window', default=False)
args = parser.parse_args() args = parser.parse_args()
logger.info(f'Starter arguments: {args}')
if args.console_reader_class == 'ConsoleReaderSocket': if args.console_reader_class == 'ConsoleReaderSocket':
conole_reader_class = console_reader.ConsoleReaderSocket conole_reader_class = console_reader.ConsoleReaderSocket

View File

@ -372,7 +372,7 @@ class SpawnBase:
} }
) )
console_class_parameters_kv_pairs = [ console_class_parameters_kv_pairs = [
f'--{k}={v}' for k, v in self.console_class_parameters.items() f'--{k}={v}'for k, v in self.console_class_parameters.items() if v is not None
] ]
console_class_parameters_str = ' '.join(console_class_parameters_kv_pairs) console_class_parameters_str = ' '.join(console_class_parameters_kv_pairs)
args_str = join_args(args) args_str = join_args(args)

View File

@ -76,7 +76,7 @@ def init_logger(logger):
logger.setLevel(logger_level) logger.setLevel(logger_level)
logger_filename = f'{logger_filename}.log' logger_filename = f'{logger_filename}.log'
os.makedirs(os.path.dirname(logger_filename), exist_ok=True) os.makedirs(os.path.dirname(logger_filename), exist_ok=True)
fh = logging.FileHandler(logger_filename, 'w', 'utf-8') fh = logging.FileHandler(logger_filename, 'a', 'utf-8')
formatter = logging.Formatter( formatter = logging.Formatter(
'%(asctime)s - %(filename)s:%(lineno)d - %(levelname)s - %(message)s') '%(asctime)s - %(filename)s:%(lineno)d - %(levelname)s - %(message)s')
fh.setFormatter(formatter) fh.setFormatter(formatter)