Decode bytes into a string using the system locale. Useful on Windows where it can be unusual (e.g. cp1252)
(x)
| 909 | |
| 910 | |
| 911 | def decode_locale_str(x): |
| 912 | # type: (bytes) -> str |
| 913 | """ |
| 914 | Decode bytes into a string using the system locale. |
| 915 | Useful on Windows where it can be unusual (e.g. cp1252) |
| 916 | """ |
| 917 | return x.decode(encoding=locale.getlocale()[1] or "utf-8", errors="replace") |
| 918 | |
| 919 | |
| 920 | class ContextManagerSubprocess(object): |
no test coverage detected