Skip to content

[Bug]: Some session ids do not have _language #608

@TheCommCraft

Description

@TheCommCraft

scratchattach version

What happened?

When you try to login_by_id with a newer session id, it can fail because there is no _language field in the session_id.

Your code.

-

Traceback

Traceback (most recent call last):
  File "<python-input-54>", line 1, in <module>
    sess_3 = scratchattach.login_by_id(pyperclip.paste())
  File "C:\Users\gine\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\scratchattach\site\session.py", line 1136, in login_by_id
    _session = Session(id=session_id, username=username, session_string=session_string)
  File "<string>", line 15, in __init__
  File "C:\Users\gine\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\scratchattach\site\session.py", line 115, in __post_init__
    self._process_session_id()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "C:\Users\gine\AppData\Local\Python\pythoncore-3.14-64\Lib\site-packages\scratchattach\site\session.py", line 164, in _process_session_id
    self.language = data["_language"]
                    ~~~~^^^^^^^^^^^^^
KeyError: '_language'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs triageNeed to apply low priority/high priority etcbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions