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

replace md5 with sha256 #2905

merged 1 commit into from Mar 3, 2022

replace md5 with sha256 #2905

merged 1 commit into from Mar 3, 2022


Copy link

@tomjelinek tomjelinek commented Mar 3, 2022


MD5 is unavailable on systems with active FIPS (Federal Information Processing Standards) mode, such as RHEL or CentOS. That makes black crash when run on such systems:

python -m black --config pyproject.toml --check pcs/ pcs_test/
Traceback (most recent call last):
  File "/usr/lib64/python3.6/", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/", line 85, in _run_code
    exec(code, run_globals)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 3, in <module>
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 1424, in patched_main
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/", line 1053, in main
    rv = self.invoke(ctx)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 556, in main
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 768, in reformat_many
  File "/usr/lib64/python3.6/asyncio/", line 484, in run_until_complete
    return future.result()
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 795, in schedule_formatting
    cache = read_cache(mode)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 47, in read_cache
    cache_file = get_cache_file(mode)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 61, in get_cache_file
    return CACHE_DIR / f"cache.{mode.get_cache_key()}.pickle"
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/", line 185, in get_cache_key
ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS

We ran into the same issue in python/mypy#7976 and tornadoweb/tornado#2776, you can check that for relevant discussions

Checklist - did you ...

  • Add a CHANGELOG entry if necessary?
  • Add / update tests if necessary?
    • I ran the testsuite, it passed. It doesn't look like there's a need to add / update tests.
  • Add new / update outdated documentation?
    • I think this is out of scope of documentation.

Copy link

@JelleZijlstra JelleZijlstra left a comment

Thanks! This does need a changelog because it fixes a user-visible issue.

Copy link
Contributor Author

@tomjelinek tomjelinek commented Mar 3, 2022

Thanks! This does need a changelog because it fixes a user-visible issue.

Right! Not sure what was I thinking about. I pushed a new version of the patch.

@tomjelinek tomjelinek requested a review from JelleZijlstra Mar 3, 2022 Outdated Show resolved Hide resolved
MD5 is unavailable on systems with active FIPS mode. That makes black
crash when run on such systems.
@JelleZijlstra JelleZijlstra self-assigned this Mar 3, 2022
Copy link

@github-actions github-actions bot commented Mar 3, 2022

diff-shades reports zero changes comparing this PR (177cec4) to main (1475264).

What is this? | Workflow run | diff-shades documentation

@JelleZijlstra JelleZijlstra merged commit 67eaf24 into psf:main Mar 3, 2022
38 checks passed
Copy link

@ichard26 ichard26 commented Mar 3, 2022

Thank you so much for your contribution! This project is only possible by contributions like these 🖤. You're awesome, @tomjelinek, if you have any feedback to share please to do here: #2238 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants