Okay, so several sources on the web claim that it's not such a brilliant idea to reload(sys) in order to get back the function. The docs even state explicitly:
This function is only intended to be used by the site module implementation and, where needed, by sitecustomize. Once used by the site module, it is removed from the sys module’s namespace.
Okay, so several sources on the web claim that it's not such a brilliant idea to reload(sys) in order to get back the function. The docs even state explicitly:
This function is only intended to be used by the site module implementation and, where needed, by sitecustomize. Once used by the site module, it is removed from the sys module’s namespace.
Source: https:/ /docs.python. org/2/library/ sys.html# sys.setdefaulte ncoding
Back to the drawing board.