#error:underlying buffer has been detached
#Envirment: Docker, Django3.2.5, pyhton3.6
Scenario: the above error occurs every time I execute Python 3 manage.py runserver 0.0.0.0:8000
Finally, the problem was that I introduced the following code into some Python files
sys.stdout = codecs.getwriter('utf-8')(sys.stdout.detach()) # System current default encoding format
However, this code is a habitual way of writing the default output code in Python 2.
Solution: delete all sys.stdout in the .Py file
Similar Posts:
- UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1:
- [Solved] Unicode decode error in the background when the robot framework is running
- When debugging stored procedure, ora-20000: oru-10027: buffer overflow is prompted
- After the JVM is started, setting the system property file.encoding again cannot affect the default encoding of the system & sun.jnu.encoding
- Docker Container Performance Monitoring Tool: google/cadvisor
- Python Error: Non-UTF-8 code starting with ‘\xe7’ [How to Solve]
- docker: Error response from daemon: Conflict. The container name “/xx” is already in use
- TypeError: the JSON object must be str, not ‘bytes’
- [Solved] Error: Service ‘XXX ‘failed to build:mainfest for docker.io/phusion/baseimage:latest not founded
- [Ubuntu18.04] Docker Start Error: Got permission denied while trying to connect to the Docker daemon socket