-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Option to skip padding for base64 urlsafe encoding/decoding #73613
Comments
Suggest changing base64 module to better handle encoding schemes that don't use padding. RFC4648 specifically makes an exemption for this and it should be better supported in Python's standard library. There is a related closed issue [5] asking for the padding to be removed or altered which wouldn't comply with the spec. This request is different with a view to better support the wider specification. Proposed behaviour adapted from resolution that ruby discussion on same topic [6]:
If that sounds sensible I'd like to put a patch/PR together. From wikipedia [7]:
|
This sounds reasonable. I ran into a similar issue today trying to decode a JSON Web Key. Although I don't have any real say, I'd say that if you put together a patch it may have a higher chance to get reviewed. I wonder about the following:
If you are still interested in putting together a patch, post a comment. Otherwise I may work on a patch for this. |
Hi Robert, It would be at least a week or two before I could take another look at this so please feel free to work on it. Not sure why I didn't write a patch at the time! |
Hi, What is the status of this issue? there are many application that require url safe base64 encoding such as JOSE (JWT) which require ugly workarounds because of this bug or actually fail because of the bug. From the (RFC-4648)[https://www.rfc-editor.org/rfc/rfc4648#section-5] """ The python bytes/str length falls into the definition of implicitly. Please support this behavior per RFC, there is no need for an additional parameter, just to read up to the end of the buffer. Regards, |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: