-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Base64 base64decode does not ignore whitespace, but should #32397
Comments
according to this post and the Wikipedia page it points to, |
It's not fixed, the example above has the same issue on 1.1 and master. |
Why is that I cannot reproduce this?
|
Well that sure is different, but it isn't correct either. |
Also, I find this behavior non local:
|
@Moelf Sorry, I don't understand your point. Anything wrong in your example? I think it seems to be working as I expect.
|
@bicycle1885 That's my point. The bug only appears when you have the complete |
Ah, okay. It makes sense. |
Hi -- I've submitted a #32457 which fixes the issue. |
Thanks for tracking this down! Does this patch also work on the sample input with a newline at the end? Currently I get:
|
@christopher-dG yes it does. But you're right, I have added a torture test. |
* bug fixed in read_to_buffer * added test for #32397. * switch back to original case * added torture test for long encoded string randomly laced with spaced
Can we close this issue? |
perhaps one might want to backport #32457 to 1.2 though |
Closed by #32457, which has been tagged to backport. |
I'm not sure that there's actually anything in the RFC about this, but base64 strings often have newlines at regular intervals (GitHub for example sends file contents as 60-char lines).
URIÄÄòser
is a pretty interesting way to spellURIParser
.Plugging that same string into Python's
base64.b64decode
works as expected.Applying
replace(s, r"\s" => "")
before decoding works, but it shouldn't be necessary and probably performs less than optimally.Discovered through debugging this.
The text was updated successfully, but these errors were encountered: