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개

© SIRSOFT
현재 페이지 제일 처음으로