(s)
| 230 | # return str on python3. Don't want to unconditionally |
| 231 | # decode because that results in unicode on python2 |
| 232 | def maybe_decode(s): |
| 233 | # NEXTBREAK: remove |
| 234 | if str == bytes: |
| 235 | return s |
| 236 | else: |
| 237 | # backslashreplace here because sometimes libmagic will return metadata in the charset |
| 238 | # of the file, which is unknown to us (e.g the title of a Word doc) |
| 239 | return s.decode('utf-8', 'backslashreplace') |
| 240 | |
| 241 | |
| 242 | try: |
no outgoing calls
no test coverage detected
searching dependent graphs…