diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2013-05-21 23:37:35 -0400 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2013-05-21 23:37:35 -0400 |
| commit | ca882263f8521022cf6759e1066bb85fb20e874b (patch) | |
| tree | 5f539933d50a7ec4911d7c41df8e956c9987e535 | |
| parent | 98dbd1606add76b2e34c91ded7f89891fade0af3 (diff) | |
| download | flake8-ca882263f8521022cf6759e1066bb85fb20e874b.tar.gz | |
Update this to deal with Marc and Bruno's names
Strings are hard, let's introduce hacks.
| -rwxr-xr-x | bin/git-patch-to-hg-export.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/git-patch-to-hg-export.py b/bin/git-patch-to-hg-export.py index ae2b4be..118e94e 100755 --- a/bin/git-patch-to-hg-export.py +++ b/bin/git-patch-to-hg-export.py @@ -47,7 +47,7 @@ def git_patch_to_hg(fin, fout): # NOTE: there will still be an index line after each diff --git, but it # will be ignored for line in fin: - fout.write(line) + fout.write(line.encode('utf-8')) # NOTE: the --/version will still be at the end, but it will be ignored @@ -58,7 +58,10 @@ def open_file(): import requests import io resp = requests.get(sys.argv[1]) - return io.StringIO(resp.content) if resp.ok else io.StringIO('') + if resp.ok: + return io.StringIO(resp.content.decode('utf-8')) + else: + return io.StringIO('') elif os.path.exists(sys.argv[1]): return open(sys.argv[1]) return sys.stdin |
