python 3.8 초기 설치후 구동시 TypeError발생(미지원 문법 사용?) > 그누보드6 버그

그누보드6 버그

그누보드6 버그를 알려주세요.

python 3.8 초기 설치후 구동시 TypeError발생(미지원 문법 사용?) 정보

python 3.8 초기 설치후 구동시 TypeError발생(미지원 문법 사용?)

본문

홈페이지에는 3.8 이상 파이썬 지원으로 표시되었습니다만.

아래 코드중 str | Path 부분 문법을 python 3.8.20에서 지원 못 하나 봅니다.

 

g6/lib/slowapi/__init__.py 소스 발췌

 

class CustomConfig(Config):
    """.env 파일을 utf-8로 읽기 위한 CustomConfig 클래스"""
    def _read_file(self, file_name: str | Path) -> dict[str, str]:
        file_values: dict[str, str] = {}
        with open(file_name, encoding="utf-8") as input_file:
            for line in input_file.readlines():
                line = line.strip()
                if "=" in line and not line.startswith("#"):
                    key, value = line.split("=", 1)
                    key = key.strip()
                    value = value.strip().strip("\"'")
                    file_values[key] = value
        return file_values

 

 

아래는 유사하게 작성한 코드인데, 역시 동일한 에러가 발생하네요.

 

1982490798_1729600314.5546.png

추천
0

댓글 0개

전체 8 |RSS
그누보드6 버그 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT