This is an archive of the discontinued LLVM Phabricator instance.

'cat' command for internal shell - Support Python 3
ClosedPublic

Authored by chamalsl on Mar 29 2018, 9:23 PM.

Details

Summary

LLVM Bug Id : 36449

Revision 328563 caused tests to fail under python 3.

  1. This patch modified cat.py file to support both python 2 and 3.
  2. This patch also fixes CRLF issues on Windows.

Diff Detail

Repository
rL LLVM

Event Timeline

chamalsl created this revision.Mar 29 2018, 9:23 PM

I tried below code to reopen stdout in binary mode as suggested in https://reviews.llvm.org/D43501.
sys.stdout = os.fdopen(sys.stdout.fileno(),"wb")
This worked for both python 2 and python 3.
But I could not get it to fix Windows CRLF issue.

chamalsl updated this revision to Diff 140529.Mar 31 2018, 2:43 AM

Modified the fix to get rid of ord function.

rnk accepted this revision.Apr 3 2018, 3:35 PM

lgtm

This revision is now accepted and ready to land.Apr 3 2018, 3:35 PM
This revision was automatically updated to reflect the committed changes.