Python에서 sqlite로 파일경로 insert 시 인코딩 에러

sqlite3 데이터베이스에 파일 경로를 삽입하니 아래와 같은 에러가 발생했다. sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings. 문자열을 아래와 같이 utf-8로 디코딩하면 해결된다. ‘path_to_somewhere’.decode(‘utf-8’)  

Python에서 sqlite로 파일경로 insert 시 인코딩 에러 Read More »