Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
This repository was archived by the owner on Aug 30, 2026. It is now read-only.

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

Description

@Taewan-P
  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/python@3.12/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/python@3.12/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/python@3.12/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 가 발생합니다.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions