typeError:can only concatenate str(not"bytes")to str
python 3.4 이후 유 니 코드(value,utf-8)를 직접 사용 할 수 없 기 때 문 입 니 다.
그래서 코드
data = '{"id":"' + location_key_id + '","location_name": "' + unicode(location_name, 'utf-8') + '","leaf:"'+true+'"}'
삭제 가 필요 하면 바로:
data = '{"id":"' + location_key_id + '","location_name": "' + location_name + '","leaf:"'+true+'"}'
호출 코드 가 잘못 되 었 습 니 다.
can only concatenate str (not "bytes") to str
다음으로 변경:
data = '{"id":"' + location_key_id + '","location_name": "' + str(location_name) + '","leaf:"'+true+'"}'
문제 해결!!
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
ROS 시스템 은 python 패 키 지 를 실행 가능 한 파일 로 컴 파일 하 는 간단 한 절차 입 니 다.주 함 수 는 현재 디 렉 터 리 에 남아 있 고 호출 된 파일 은 하위 디 렉 터 리 에 있 으 며 하위 디 렉 터 리 는 이 패키지 이름과 같 습 니 다. 다음 내용 을 추가,그 중 addsubdirectory ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.