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
merged 1 commit into from Mar 3, 2022
Merged

replace md5 with sha256 #2905

merged 1 commit into from Mar 3, 2022

Conversation

tomjelinek
Copy link
Contributor

@tomjelinek tomjelinek commented Mar 3, 2022

Description

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/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/__main__.py", line 3, in <module>
    patched_main()
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/__init__.py", line 1424, in patched_main
    main()
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/__init__.py", line 556, in main
    workers=workers,
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/__init__.py", line 768, in reformat_many
    executor=executor,
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/__init__.py", line 795, in schedule_formatting
    cache = read_cache(mode)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/cache.py", line 47, in read_cache
    cache_file = get_cache_file(mode)
  File "/root/pyenvs/pcs/lib64/python3.6/site-packages/black/cache.py", 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/mode.py", line 185, in get_cache_key
    md5((",".join(sorted(self.python_cell_magics))).encode()).hexdigest(),
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
Collaborator

@JelleZijlstra JelleZijlstra left a comment

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

@tomjelinek
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
CHANGES.md 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
@github-actions
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
@ichard26
Copy link
Collaborator

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants