Skip to content

Commit

Permalink
[cli-] support encoding_errors option for stdin #2047
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Oct 8, 2023
1 parent 60d6f22 commit 6bdc384
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion visidata/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def duptty():
try:
fin = open('/dev/tty')
fout = open('/dev/tty', mode='w')
stdin = open(os.dup(0), encoding=vd.options.getonly('encoding', 'global', 'utf-8'))
stdin = open(os.dup(0),
encoding=vd.options.getonly('encoding', 'global', 'utf-8'),
errors=vd.options.getonly('encoding_errors', 'global', None)) #2047
stdout = open(os.dup(1)) # for dumping to stdout from interface
os.dup2(fin.fileno(), 0)
os.dup2(fout.fileno(), 1)
Expand Down

0 comments on commit 6bdc384

Please sign in to comment.