Skip to content

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

Open

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'

Activity

  1. added
    bug
    Needs triage
    on May 9, 2026
  2. TheCommCraft commented on May 9, 2026

    @TheCommCraft
    CollaboratorAuthor

    It might fail if you selected no language. Only then, the _language field will be missing

  3. changed the title [-][Bug]: Newer session ids do not have _language[/-] [+][Bug]: Some session ids do not have _language[/+] on May 9, 2026
  4. faretek1 commented on May 9, 2026

    @faretek1
    Collaborator

    Should we remove that field then?

  5. TheCommCraft commented on May 10, 2026

    @TheCommCraft
    CollaboratorAuthor

    Yes, probably

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

    Needs triagebug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions