From 1b609fc77d8e81cb5e20908bbac7ac681231e4d1 Mon Sep 17 00:00:00 2001 From: josch Date: Fri, 15 Jun 2012 17:13:32 +0200 Subject: [PATCH] read and write in binary --- img2pdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/img2pdf.py b/img2pdf.py index 765c9c3..649db90 100644 --- a/img2pdf.py +++ b/img2pdf.py @@ -201,9 +201,9 @@ def main(images, dpi, title=None, author=None, creator=None, producer=None, if __name__ == "__main__": parser = argparse.ArgumentParser(description='lossless conversion/embedding of images (in)to pdf') - parser.add_argument('images', metavar='infile', type=argparse.FileType('r'), + parser.add_argument('images', metavar='infile', type=argparse.FileType('rb'), nargs='+', help='input file(s)') - parser.add_argument('-o', '--output', metavar='out', type=argparse.FileType('w'), + parser.add_argument('-o', '--output', metavar='out', type=argparse.FileType('wb'), default=sys.stdout, help='output file (default: stdout)') def positive_float(string): value = float(string)