-
Notifications
You must be signed in to change notification settings - Fork 6
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
Removed CGI to be compatible with python 3.13 #11
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your interest on keeping this script up to date!
However, I see a few problems with your changes, that you could check in the comments below.
From those comments, I can know you didn't test your changes, because you are getting the wrong headers, and the else
not being in a new line will throw a syntax error.
Please, ensure that your changes work and that you have tested it. I don't have content on the Aula Global at the moment, as I'm not a current student of the UC3M, so I cannot test them. I depend on you to do it.
Again, if you are willing to improve this script, and you provide a working PR, I'll be more than happy to merge it. Thank you very much.
@@ -61,7 +61,9 @@ | |||
# Check if success | |||
url = br.open(BASE_URL) | |||
login = url.get('X-Frame-Options', None) | |||
status, _ = cgi.parse_header(login) | |||
m = Message() | |||
m['content-type'] = login |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't want to extract the content-type
header here. This seems like a copy-paste from the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content type works on this section, if the password is wrong, it exits the script.
I can check other headers, but this one works.
value, params = cgi.parse_header(cdheader) | ||
else: | ||
m = Message() | ||
m['content-type'] = cdheader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
The university has removed the ability to log in using username and password. This script has helped me over the years and has worked great. I have a repository with the alternative. I'll fix the script so it works, but I don't have the ability to test it anymore. |
I uploaded the exact script I have been using, as I had modified some aspects, like added a parameter and a naming replacement (that I deleted, as it was only for groups from CS) |
Sorry, misclick with closing the PR |
I have modified the code, removing the cgi dependency to satisfy python3.13 requirements. CGI is a library that was deprecated in python 3.12 PEP 594
Instead, I have used email.message, a library integrated in python by default.