Commit a40f4f7
committed
Replace string_escape with simple replacements
Holy mother of God. Making string_escape work across Python 2 and 3 is
an absolute nightmare. The bytes-to-bytes encoders were removed in
Python 3, so the only way to use them is to use unicode_escape directly
from the codecs package, but this makes a complete hash of the task if
the data you give it contains unescaped unicode:
>>> codecs.decode('åéïò', 'unicode_escape')
'åéïò'
>>> codecs.decode('åéïò'.encode('utf8'), 'unicode_escape')
'åéïò'
WTF!? Anyway. Life is too short. This will make the tests pass.
Fixes #128.1 parent 920b0b0 commit a40f4f7
2 files changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
| |||
0 commit comments