To address https://github.com/scottrogowski/code2flow/issues/28 The windows user had an error b/c their default encoding was cp1252 and they were trying to read a unicode file with emojis I don't have that installed but was able to reproduce by changing to US-ASCII which I assum
()
| 104 | |
| 105 | |
| 106 | def test_weird_encoding(): |
| 107 | """ |
| 108 | To address https://github.com/scottrogowski/code2flow/issues/28 |
| 109 | The windows user had an error b/c their default encoding was cp1252 |
| 110 | and they were trying to read a unicode file with emojis |
| 111 | I don't have that installed but was able to reproduce by changing to |
| 112 | US-ASCII which I assume is a little more universal anyway. |
| 113 | """ |
| 114 | |
| 115 | locale.setlocale(locale.LC_ALL, 'en_US.US-ASCII') |
| 116 | code2flow('test_code/py/weird_encoding', |
| 117 | output_file='/tmp/code2flow/out.json', |
| 118 | hide_legend=False) |
| 119 | with open('/tmp/code2flow/out.json') as f: |
| 120 | jobj = json.loads(f.read()) |
| 121 | assert set(jobj.keys()) == {'graph'} |
| 122 | |
| 123 | |
| 124 | def test_repr(): |