From fcaedceacca3463c731c4eeb1907df2fad9f8781 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Fri, 3 Apr 2026 09:29:47 -0400 Subject: [PATCH] allow more characters in passwords read from file strip() with no arguments would mean that a password read from a file could not contain a leading space. While that is unusual, it is also true that in such an edge case, the use of the password file would be more likely to manage the weird string. removesuffix('\n') should be the most targeted possible cleanup. --- changelog.md | 1 + mycli/main.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 2a6e4ad1..5aa4150e 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ Features --------- * Continue to expand TIPS. * Make `--progress` and `--checkpoint` strictly by statement. +* Allow more characters in passwords read from a file. Bug Fixes diff --git a/mycli/main.py b/mycli/main.py index 7f47e769..31c5eb9a 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -2211,7 +2211,7 @@ def get_password_from_file(password_file: str | None) -> str | None: return None try: with open(password_file) as fp: - password = fp.readline().strip() + password = fp.readline().removesuffix('\n') return password except FileNotFoundError: click.secho(f"Password file '{password_file}' not found", err=True, fg="red")