<commit_before>--- _test.py.orig	2016-09-02 23:41:34.286781100 +0200
+++ "/c/Program Files/Python35/lib/site-packages/cram/_test.py"	2016-09-02 23:48:17.937263300 +0200
@@ -143,6 +143,8 @@
             after.setdefault(pos, []).append(line)
     stdin.append(b('echo %s %s $?\n' % (usalt, i + 1)))
 
+    env = {k: v.decode('utf-8') if isinstance(v, bytes) else v for k, v in env.items()}
+
     output, retcode = execute(shell + ['-'], stdin=b('').join(stdin),
                               stdout=PIPE, stderr=STDOUT, env=env)
     if retcode == 80:<commit_msg>cram: Fixed inconsistent line endings in cram patch<commit_after>--- _test.py.orig	2016-09-03 00:50:27.505527300 +0200
+++ "/c/Program Files/Python35/lib/site-packages/cram/_test.py"	2016-09-03 00:48:48.708932100 +0200
@@ -143,11 +143,15 @@
             after.setdefault(pos, []).append(line)
     stdin.append(b('echo %s %s $?\n' % (usalt, i + 1)))
 
+    env = {k: v.decode('utf-8') if isinstance(v, bytes) else v for k, v in env.items()}
+
     output, retcode = execute(shell + ['-'], stdin=b('').join(stdin),
                               stdout=PIPE, stderr=STDOUT, env=env)
     if retcode == 80:
         return (refout, None, [])
 
+    output = output.replace(b'\r\n', b'\n').replace(b'\r', b'\n')
+
     pos = -1
     ret = 0
     for i, line in enumerate(output[:-1].splitlines(True)):
{'fraction_non_alphanumeric': 0.20190895741556533, 'fraction_numerical': 0.10352422907488987, 'mean_word_length': 2.7138964577656677, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5408646', 'n_tokens_mistral': 622, 'n_tokens_neox': 520, 'n_words': 110}