mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
fix layout2layout with stdin/out for Py3.
sys.stdin and sys.stdout expect a Unicode string, with bytes we must use sys.std(in|out).buffer.
This commit is contained in:
parent
0d49918c0c
commit
8556cb1c66
@ -1254,13 +1254,17 @@ def main(argv):
|
||||
# Open files
|
||||
if options.input_file:
|
||||
source = open(options.input_file, 'rb')
|
||||
else:
|
||||
elif PY2:
|
||||
source = sys.stdin
|
||||
else:
|
||||
source = sys.stdin.buffer
|
||||
|
||||
if options.output_file:
|
||||
output = open(options.output_file, 'wb')
|
||||
else:
|
||||
elif PY2:
|
||||
output = sys.stdout
|
||||
else:
|
||||
output = sys.stdout.buffer
|
||||
|
||||
if options.format > currentFormat:
|
||||
error("Format %i does not exist" % options.format);
|
||||
|
Loading…
Reference in New Issue
Block a user