Skip to content

Commit

Permalink
fix: always use parameter UTF-8 fallback
Browse files Browse the repository at this point in the history
Even when the filesystem encoding and sys.argv encoding are the same we
should still fall back to trying UTF-8 for decoding command line
arguments.
  • Loading branch information
GielVanSchijndel-TomTom committed Feb 10, 2020
1 parent cd35e79 commit cfe9117
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions click/types.py
Expand Up @@ -119,6 +119,8 @@ def convert(self, value, param, ctx):
value = value.decode(fs_enc)
except UnicodeError:
value = value.decode('utf-8', 'replace')
else:
value = value.decode('utf-8', 'replace')
return value
return value

Expand Down

0 comments on commit cfe9117

Please sign in to comment.