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

[Bug]KeyError: 'XSRF-TOKEN' #17

Open
Fireond opened this issue Oct 24, 2024 · 0 comments
Open

[Bug]KeyError: 'XSRF-TOKEN' #17

Fireond opened this issue Oct 24, 2024 · 0 comments

Comments

@Fireond
Copy link

Fireond commented Oct 24, 2024

运行learn ddl,learn submit等命令时报错:

Traceback (most recent call last):
  File "/Users/user/anaconda3/bin/learn", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/user/anaconda3/lib/python3.11/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/anaconda3/lib/python3.11/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/user/anaconda3/lib/python3.11/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/anaconda3/lib/python3.11/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/anaconda3/lib/python3.11/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/anaconda3/lib/python3.11/site-packages/thulearn2018/learn.py", line 61, in submit
    learn.set_semester()
  File "/Users/user/anaconda3/lib/python3.11/site-packages/thulearn2018/browser.py", line 66, in set_semester
    content = self.jh.loads(self.get(settings.semester_url))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/anaconda3/lib/python3.11/site-packages/thulearn2018/browser.py", line 52, in get
    '_csrf': self.session.cookies.get_dict()['XSRF-TOKEN']
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'XSRF-TOKEN'

#4 中的报错相同

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