Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-31116: Add Z85 variant to base64#30598

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
serhiy-storchaka merged 11 commits intopython:mainfrommatan1008:add-z85-variant
Feb 25, 2024

Conversation

matan1008
Copy link
Contributor

@matan1008matan1008 commentedJan 14, 2022
edited by serhiy-storchaka
Loading

@github-actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelFeb 14, 2022
Copy link
Contributor

@MaxwellDupreMaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This needs some documentation a single short NEWS entry I don't think is enough. A short description plus maybe a link to reference.

matan1008 reacted with thumbs up emoji
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I apologize for the fact that this PR was not reviewed earlier. The idea itself looks reasonable to me, and the implementation looks clever, so I am going to approve this change.

Please add a variant of test_b85decode_errors for Z85. I suspect that there may be some issues here. Also please add a What's New entry and updateversionadded directives.

matan1008 reacted with thumbs up emoji
@bedevere-app
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@matan1008
Copy link
ContributorAuthor

I have made the requested changes; please review again

Comment on lines 787 to 791
self.assertRaises(ValueError, base64.z85decode, b'%')
self.assertRaises(ValueError, base64.z85decode, b'%N')
self.assertRaises(ValueError, base64.z85decode, b'%Ns')
self.assertRaises(ValueError, base64.z85decode, b'%NsC')
self.assertRaises(ValueError, base64.z85decode, b'%NsC1')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The first four should be prefixes ofb'%nSc0' which is a Z85 encodedb'\xff\xff\xff\xff'. The last one should beb'%nSc1', it represents 0x100000000 which cannot be packed in 4 bytes.

Perhaps it needs a comment.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Fixed, Thanks!

@serhiy-storchakaserhiy-storchaka removed the staleStale PR or inactive for long period of time. labelFeb 25, 2024
with self.assertRaises(ValueError, msg=bytes([c])):
base64.z85decode(b'0000' + bytes([c]))

# b'\xff\xff\xff\xff' encodes to b'%nSc1', the following will overflow:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
# b'\xff\xff\xff\xff' encodes to b'%nSc1', the following will overflow:
# b'\xff\xff\xff\xff' encodes to b'%nSc0', the following will overflow:

matan1008 reacted with thumbs up emoji
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM.

For future, please do not use force push during review. It makes more difficult to see the incremental changes and requires to start reviewing from the start after every change.

matan1008 reacted with thumbs up emoji
@serhiy-storchakaserhiy-storchaka merged commitc40b5b9 intopython:mainFeb 25, 2024
@underrununderrunmannequin mentioned this pull requestApr 10, 2022
@serhiy-storchaka
Copy link
Member

Thank you for your contribution@matan1008.

matan1008 reacted with hooray emoji

@matan1008
Copy link
ContributorAuthor

Thank you for accepting it!

woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull requestMar 4, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull requestApr 17, 2024
LukasWoodtli pushed a commit to LukasWoodtli/cpython that referenced this pull requestJan 22, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

@MaxwellDupreMaxwellDupreMaxwellDupre requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@matan1008@serhiy-storchaka@MaxwellDupre@the-knights-who-say-ni@ezio-melotti@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp