jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/405734 )
Change subject: crontab: Make the input file is binary when it is sys.stdin ...................................................................... crontab: Make the input file is binary when it is sys.stdin When the argument is `-`, python argparse.FileType will return sys.stdin regardless of whether the mode is binary, due to https://bugs.python.org/issue14156. We check that file and set it to its buffer (binary) when the file is sys.stdin (text). Bug: T181948 Bug: T185314 Change-Id: I97c076060dc8909097f66d4f5da1994abd27781f --- M debian/changelog M misctools/oge-crontab 2 files changed, 10 insertions(+), 0 deletions(-) Approvals: Arturo Borrero Gonzalez: Looks good to me, approved jenkins-bot: Verified diff --git a/debian/changelog b/debian/changelog index c8fb65c..e5d4707 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +toollabs (1.28) unstable; urgency=medium + + * crontab: Make the input file is binary when it is sys.stdin + + -- YiFei Zhu <[email protected]> Mon, 22 Jan 2018 16:37:02 +0000 + toollabs (1.27) unstable; urgency=medium [ YiFei Zhu] diff --git a/misctools/oge-crontab b/misctools/oge-crontab index 5495ce1..b8859db 100644 --- a/misctools/oge-crontab +++ b/misctools/oge-crontab @@ -251,6 +251,10 @@ args = parser.parse_args() + # https://bugs.python.org/issue14156 + if args.file is sys.stdin: + args.file = args.file.buffer + if args.i and args.operation != 'r': parser.error('argument -i: only applicable with -r') -- To view, visit https://gerrit.wikimedia.org/r/405734 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I97c076060dc8909097f66d4f5da1994abd27781f Gerrit-PatchSet: 1 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: Zhuyifei1999 <[email protected]> Gerrit-Reviewer: Arturo Borrero Gonzalez <[email protected]> Gerrit-Reviewer: BryanDavis <[email protected]> Gerrit-Reviewer: Merlijn van Deen <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
