Skip to content

Commit

Permalink
Fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Nov 6, 2021
1 parent d04ca79 commit 84973b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/outgoing/passwords.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ def file_scheme(spec: Any, configpath: Optional[AnyPath] = None) -> str:
)
filepath = resolve_path(path, configpath)
try:
return filepath.read_text().strip()
with open(filepath) as fp:
# Open with open() instead of using filepath.read_text() in order
# for the error message in PyPy-3.[78] to not include "PosixPath"
return fp.read().strip()
except OSError as e:
raise InvalidPasswordError(f"Invalid 'file' path: {e}", configpath=configpath)

Expand Down

0 comments on commit 84973b6

Please sign in to comment.