Skip to content

Comments

fix: Correctly initialize Account session in API helper#50

Open
cgumb wants to merge 1 commit intonyuoss:mainfrom
cgumb:bug-fix
Open

fix: Correctly initialize Account session in API helper#50
cgumb wants to merge 1 commit intonyuoss:mainfrom
cgumb:bug-fix

Conversation

@cgumb
Copy link

@cgumb cgumb commented Oct 11, 2025

Summary

Fixes a bug in src/gradescopeapi/api/api.py where the Account class was being initialized with an invalid session object.

Details

The get_account helper function was incorrectly passing the function reference get_gs_connection_session to the Account class constructor. It should have been passing the
requests.Session object returned by calling that function.

This resulted in an Account instance where self.session was a function, not a session object.
The fix is to correctly call get_gs_connection_session() to pass the expected session object during initialization.

Reference to the issue

This latent bug was discovered during the development and debugging of a new utility script that relied on the API's components.

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

Successfully merging this pull request may close these issues.

1 participant