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

unsupported hash type sha #7778

Closed
4 tasks done
gygabyte017 opened this issue Apr 8, 2023 · 3 comments
Closed
4 tasks done

unsupported hash type sha #7778

gygabyte017 opened this issue Apr 8, 2023 · 3 comments
Labels
kind/bug Something isn't working as expected status/external-issue Issue is caused by external project (platform, dep, etc)

Comments

@gygabyte017
Copy link

  • Poetry version: 1.4.2
  • Python version: 3.8.16
  • OS version and name: Windows Server 2019
  • pyproject.toml: none
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

When installing the package swat I get this error: unsupported hash type sha

>poetry add swat@latest
Using version ^1.12.1 for swat

Updating dependencies
Resolving dependencies... Downloading https://files.pythonhosted.org/packages/3c/c8/5d6bb20ba20d8770e933d8c0fe956fdc11940af2c39f5b23e02196e0395c/swat-1.12.1-0-cp27-cp27m-macosx_10_9_x86_64.whl#sha256=30ad0ce7e69fa40e19433aa8327b55ae1c0f092fResolving dependencies... (1.6s)

Writing lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing swat (1.12.1): Failed

  ValueError

  unsupported hash type

  at D:\miniconda\lib\hashlib.py:157 in __hash_new
      153│         # It does neither support keyed blake2 nor advanced features like
      154│         # salt, personal, tree hashing or SSE.
      155│         return __get_builtin_constructor(name)(data, **kwargs)
      156│     try:
    → 157│         return _hashlib.new(name, data)
      158│     except ValueError:
      159│         # If the _hashlib module (OpenSSL) doesn't support the named
      160│         # hash, try using our builtin implementations.
      161│         # This allows for SHA224/256 and SHA384/512 support even though

The following error occurred when trying to handle this error:


  ValueError

  unsupported hash type sha

  at D:\miniconda\lib\hashlib.py:120 in __get_builtin_constructor
      116│     constructor = cache.get(name)
      117│     if constructor is not None:
      118│         return constructor
      119│
    → 120│     raise ValueError('unsupported hash type ' + name)
      121│
      122│
      123│ def __get_openssl_constructor(name):
      124│     if name in __block_openssl_constructor:
@gygabyte017 gygabyte017 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 8, 2023
@dimbleby
Copy link
Contributor

dimbleby commented Apr 8, 2023

You've checked the box to declare that you included output with -vvv, but you haven't done so.

The RECORDS file in the swat wheel contains nonsense hashes. Please report this to that project - https://github.com/sassoftware/python-swat/.

If you're feeling keen, please also report to https://github.com/pypa/installer/ that it would be nice if they handled this more gracefully

Edit: I reported to installer, which is the way eventually to get this to be handled gracefully. You should still report to swat that their wheel is invalid.

@Secrus Secrus added status/external-issue Issue is caused by external project (platform, dep, etc) and removed status/triage This issue needs to be triaged labels Apr 17, 2023
@abn
Copy link
Member

abn commented Mar 23, 2024

Closing this issue as the external issue has been resolved and swat@1.13.1 is installable. No real action on Poetry side. Maybe improvement on error handling here - happy to review PRs submitted to this effect.

Relevant code that installs the wheel is at

def install(self, wheel: Path) -> None:
with WheelFile.open(wheel) as source:
try:
# Content validation is temporarily disabled because of
# pypa/installer's out of memory issues with big wheels. See
# https://github.com/python-poetry/poetry/issues/7983
source.validate_record(validate_contents=False)
except _WheelFileValidationError as e:
self.invalid_wheels[wheel] = e.issues
scheme_dict = self._env.paths.copy()
scheme_dict["headers"] = str(
Path(scheme_dict["include"]) / source.distribution
)
destination = WheelDestination(
scheme_dict,
interpreter=str(self._env.python),
script_kind=self._script_kind,
bytecode_optimization_levels=self._bytecode_optimization_levels,
)
install(
source=source,
destination=destination,
# Additional metadata that is generated by the installation tool.
additional_metadata={
"INSTALLER": f"Poetry {__version__}".encode(),
},
)
.

The exception can be captured and handled here as well.

self._wheel_installer.install(archive)

@abn abn closed this as not planned Won't fix, can't repro, duplicate, stale Mar 23, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/external-issue Issue is caused by external project (platform, dep, etc)
Projects
None yet
Development

No branches or pull requests

4 participants