diff options
| author | David Lord <davidism@gmail.com> | 2021-04-12 07:36:25 -0700 |
|---|---|---|
| committer | David Lord <davidism@gmail.com> | 2021-04-12 07:36:25 -0700 |
| commit | 1167ebe1f2b678b58394332e82675300d4a0299a (patch) | |
| tree | acc9ed82d0318533bcedbeb43fd9e5757c9cc3b9 /src/click/exceptions.py | |
| parent | 3f7319081113a0bdfa8fa0b8c4ff018a8f5e5278 (diff) | |
| download | click-fsdecode.tar.gz | |
use os.fsdecode to display pathsfsdecode
Works with pathlib, consistent with Python's output.
Diffstat (limited to 'src/click/exceptions.py')
| -rw-r--r-- | src/click/exceptions.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/click/exceptions.py b/src/click/exceptions.py index ab9b312..c7c8b10 100644 --- a/src/click/exceptions.py +++ b/src/click/exceptions.py @@ -1,7 +1,7 @@ +import os from gettext import gettext as _ from gettext import ngettext -from ._compat import filename_to_ui from ._compat import get_text_stderr from .utils import echo @@ -226,12 +226,11 @@ class FileError(ClickException): """Raised if a file cannot be opened.""" def __init__(self, filename, hint=None): - ui_filename = filename_to_ui(filename) if hint is None: hint = _("unknown error") super().__init__(hint) - self.ui_filename = ui_filename + self.ui_filename = os.fsdecode(filename) self.filename = filename def format_message(self): |
