FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.7] bpo-33729: Fix issues with arguments parsing in hashlib. (GH-8346) by serhiy-storchaka · Pull Request #8581 · python/cpython · GitHub

Repository navigation

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

Merged
serhiy-storchaka merged 1 commit into
python:3.7from
serhiy-storchaka:backport-f1d36d8-3.7
Jul 31, 2018
Merged

serhiy-storchaka merged 1 commit into
python:3.7from
serhiy-storchaka:backport-f1d36d8-3.7

Conversation

serhiy-storchaka commented Jul 31, 2018 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member
  • 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)

https://bugs.python.org/issue33729

…nGH-8346)

* 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>
bedevere-bot added the type-bug An unexpected behavior, bug, or error label Jul 31, 2018
serhiy-storchaka merged commit 47957da into python:3.7 Jul 31, 2018
serhiy-storchaka deleted the backport-f1d36d8-3.7 branch July 31, 2018 07:22
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Oct 1, 2018
…ythonGH-8346) (pythonGH-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 added a commit that referenced this pull request Oct 11, 2018
…) (GH-8581) (GH-9657)

* 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL