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

Failed when saving homework files #6

Closed
keyunjie96 opened this issue Oct 30, 2018 · 1 comment
Closed

Failed when saving homework files #6

keyunjie96 opened this issue Oct 30, 2018 · 1 comment

Comments

@keyunjie96
Copy link

  1. It seems saving 3-byte file for any 'work' instance including 'work.answer' and 'work.file'
  2. I tested the downloading url when downloading from a browser. It downloaded a correct homework file. However, request.get even wget (faking as browser) failed. It may be caused by js(not sure).
  3. The content of 3-byte file: '\t\r\n'
  4. How to reproduce it:
from thu_learn import *

login()
semester = Semester(current=False)
for i, course in semester.courses:
    base_path = os.path.join('file', course.name)
    os.makedirs(base_path, exist_ok=True)
    for work in course.works:
        print('%s\%s' % (course.name, work.title))
        work_path = os.path.join(base_path, work.title)
        os.makedirs(work_path, exist_ok=True)
        if work.file:
            work.file.save(work_path)
        if work.answer:
            work.answer.save(work_path)
@keyunjie96
Copy link
Author

same as #3

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