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

[3.6] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) (GH-8581) #9657

Merged
merged 1 commit into from Oct 11, 2018

Conversation

Projects
None yet
3 participants
@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Oct 1, 2018

  • help(hashlib) didn't work because of incorrect module name in blake2b and
    blake2s classes.
  • Constructors blake2*(), sha3_(), shake_() and keccak_*() incorrectly
    accepted keyword argument "string" for binary data, but documented as
    accepting the "data" keyword argument. Now this parameter is positional-only.
  • Keyword-only parameters in blake2b() and blake2s() were not documented as
    keyword-only.
  • Default value for some parameters of blake2b() and blake2s() was None,
    which is not acceptable value.
  • The length argument for shake_*.digest() was wrapped out to 32 bits.
  • The argument for shake_128.digest() and shake_128.hexdigest() was not
    positional-only as intended.
  • TypeError messages for incorrect arguments in all constructors sha3_(),
    shake_
    () and keccak_*() incorrectly referred to sha3_224.

Also made the following enhancements:

  • More accurately specified input and result types for strings, bytes and
    bytes-like objects.
  • Unified positional parameter names for update() and constructors.
  • Improved formatting.

(cherry picked from commit f1d36d8)
(cherry picked from commit 47957da)

https://bugs.python.org/issue33729

[3.6] [3.7] bpo-33729: Fix issues with arguments parsing in hashlib. (G…
…H-8346) (GH-8581)

* help(hashlib) didn't work because of incorrect module name in blake2b and
  blake2s classes.
* Constructors blake2*(), sha3_*(), shake_*() and keccak_*() incorrectly
  accepted keyword argument "string" for binary data, but documented as
  accepting the "data" keyword argument. Now this parameter is positional-only.
* Keyword-only parameters in blake2b() and blake2s() were not documented as
  keyword-only.
* Default value for some parameters of blake2b() and blake2s() was None,
  which is not acceptable value.
* The length argument for shake_*.digest() was wrapped out to 32 bits.
* The argument for shake_128.digest() and shake_128.hexdigest() was not
  positional-only as intended.
* TypeError messages for incorrect arguments in all constructors sha3_*(),
  shake_*() and keccak_*() incorrectly referred to sha3_224.

Also made the following enhancements:

* More accurately specified input and result types for strings, bytes and
  bytes-like objects.
* Unified positional parameter names for update() and constructors.
* Improved formatting.
(cherry picked from commit f1d36d8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>.
(cherry picked from commit 47957da)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

@serhiy-storchaka serhiy-storchaka requested a review from tiran Oct 1, 2018

@serhiy-storchaka serhiy-storchaka merged commit f543e18 into python:3.6 Oct 11, 2018

6 checks passed

Azure Pipelines PR #20181002.16 succeeded
Details
bedevere/issue-number Issue number 33729 found
Details
bedevere/maintenance-branch-pr Valid maintenance branch PR title.
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@serhiy-storchaka serhiy-storchaka deleted the serhiy-storchaka:backport-47957da-3.6 branch Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.