Skip to content

Commit eb616aa

Browse files
committed
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.
1 parent ba0435f commit eb616aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mycli/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2211,7 +2211,7 @@ def get_password_from_file(password_file: str | None) -> str | None:
22112211
return None
22122212
try:
22132213
with open(password_file) as fp:
2214-
password = fp.readline().strip()
2214+
password = fp.readline().removesuffix('\n')
22152215
return password
22162216
except FileNotFoundError:
22172217
click.secho(f"Password file '{password_file}' not found", err=True, fg="red")

0 commit comments

Comments
 (0)