Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srt.reserve를 시도했을때 발생하는 JSONDecodeError #269

Open
Taewan-P opened this issue Sep 12, 2024 · 0 comments
Open

srt.reserve를 시도했을때 발생하는 JSONDecodeError #269

Taewan-P opened this issue Sep 12, 2024 · 0 comments

Comments

@Taewan-P
Copy link

  File "<Project Dir>/test.py", line 37, in reserve_train
    res = srt.reserve(train, special_seat=SeatType.GENERAL_FIRST)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<Project Dir>/venv/lib/python3.12/site-packages/SRT/srt.py", line 274, in reserve
    return self._reserve(
           ^^^^^^^^^^^^^^
  File "<Project Dir>/venv/lib/python3.12/site-packages/SRT/srt.py", line 416, in _reserve
    parser = SRTResponseData(r.text)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "<Project Dir>/venv/lib/python3.12/site-packages/SRT/response_data.py", line 15, in __init__
    self._json = json.loads(response)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None

srt.reserve를 할때, 잔여석이 없을때는 보통 SRTResponseError로 반환되나, 이후 여러번 예약을 시도하다 보면 다음과 같이 JSONDecodeError 가 발생합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant