-
TypeError: Object of type set is not JSON serializable에러 모음 2023. 1. 7. 11:26
raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable")
TypeError: Object of type set is not JSON serializable이런 에러가 떠서 무얼까 찾아보았는데
역시나...사소한 문제였다
앞전에 말했던 작은따옴표의 위치가 잘못되었다.
@app.route("/todo", methods=["GET"]) def bucket_get(): todos_list = list(db.todo.find({},{'_id':False})) return jsonify({'todos:todos_list'})
제일 막줄에 ({'todos:todos_list'})가 잘못쓴거임.
({'todos':todo_list}) 가 맞는거임.
@app.route("/todo", methods=["GET"]) def bucket_get(): todos_list = list(db.todo.find({},{'_id':False})) return jsonify({'todos':todos_list})
수정 완료!
.
.
.
.
.
작은따옴표 위치하나로 이렇게나 당황스럽다니 ㅜㅜ
언제쯤 이런 허접이같은 실수를 안할까..
그래도 팀원들의 도움으로 에러를 금방 해결할 수 있어서 넘나 다행이다
'에러 모음' 카테고리의 다른 글
(미해결)AssertionError (0) 2023.01.09 (미해결)ignoring input and appending output to 'nohup.out' (0) 2023.01.07 SyntaxError: EOL while scanning string literal (0) 2023.01.07 400 Bad Request (0) 2023.01.06 localhost:5000 연결 안됨 (0) 2023.01.05