유효기간 만료 체크해주는 부분에서 TypeError: unsupported operand type(s) 오류남.
원인 : 파이썬의 기본연산이 불가능한 타입끼리 연산을 하려고 할 때 발생 (예를 들어 문자열과 숫자는 당연히 연산 불가..)
refresh_token_expire > checkExpire
refresh_token_expire = tokens['refresh_token_expire']
refresh_token_expire = refresh_token_expire[0:10]
nowTime = datetime.date.today()
checkExpire = str(nowTime + datetime.timedelta(days=1))
refresh token이 datetime으로 저장돼서 해당 타입일 거라고 생각했는데, 파일에 저장된 값을 불러오는 거라 str 타입이었다..ㅎㅎ..
초보자의 실수. 현재 날짜를 str로 변환해주니까 오류 사라짐.
참고 : https://daewonyoon.tistory.com/385
[Python] TypeError: unsupported operand type(s) for
파이썬 초보가 겪을 수 있는 에러입니다. unsupported operand type : 지원되지 않는 피연산자 타입 으로 번역이 됩니다. 파이썬의 기본연산이 불가능한 타입끼리 연산을 하려고 할 때 발생합니다. 예를
daewonyoon.tistory.com
'기록 > Python' 카테고리의 다른 글
[Python] 파이썬 to_csv 한글 깨짐 해결 방법 (0) | 2022.06.28 |
---|---|
[Python] 파이썬 init 이란 (0) | 2022.06.21 |
[Python] 파이썬 파일 체크 os.path.isfile 사용 시 주의점 (0) | 2022.06.21 |
[Python] 파이썬 'is None'과 '==None' 차이점 (0) | 2022.06.21 |
[PyCharm] 파이참 라이브러리 연결 오류 (0) | 2022.06.21 |