Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
HashMissing Class Reference
Inheritance diagram for HashMissing:
Collaboration diagram for HashMissing:

Public Member Functions

None __init__ (self, str gotten_hash)
 
str body (self)
 
- Public Member Functions inherited from HashError
str __str__ (self)
 

Data Fields

 gotten_hash
 
 req
 
- Data Fields inherited from HashError
 req
 

Static Public Attributes

int order = 2
 
tuple head
 
- Static Public Attributes inherited from HashError
Optional req = None
 
str head = ""
 
int order = -1
 

Additional Inherited Members

- Protected Member Functions inherited from HashError
str _requirement_name (self)
 

Detailed Description

A hash was needed for a requirement but is absent.

Definition at line 515 of file exceptions.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ (   self,
str  gotten_hash 
)
:param gotten_hash: The hash of the (possibly malicious) archive we
    just downloaded

Definition at line 529 of file exceptions.py.

529 def __init__(self, gotten_hash: str) -> None:
530 """
531 :param gotten_hash: The hash of the (possibly malicious) archive we
532 just downloaded
533 """
534 self.gotten_hash = gotten_hash
535

Referenced by Protocol.__init_subclass__().

Here is the caller graph for this function:

Member Function Documentation

◆ body()

str body (   self)
Return a summary of me for display under the heading.

This default implementation simply prints a description of the
triggering requirement.

:param req: The InstallRequirement that provoked this error, with
    its link already populated by the resolver's _populate_link().

Reimplemented from HashError.

Definition at line 536 of file exceptions.py.

536 def body(self) -> str:
537 # Dodge circular import.
538 from pip._internal.utils.hashes import FAVORITE_HASH
539
540 package = None
541 if self.req:
542 # In the case of URL-based requirements, display the original URL
543 # seen in the requirements file rather than the package name,
544 # so the output can be directly copied into the requirements file.
545 package = (
546 self.req.original_link
547 if self.req.is_direct
548 # In case someone feeds something downright stupid
549 # to InstallRequirement's constructor.
550 else getattr(self.req, "req", None)
551 )
552 return " {} --hash={}:{}".format(
553 package or "unknown package", FAVORITE_HASH, self.gotten_hash
554 )
555
556
for i

Referenced by PreparedRequest.copy(), PreparedRequest.prepare_auth(), and PreparedRequest.prepare_body().

Here is the caller graph for this function:

Field Documentation

◆ gotten_hash

gotten_hash

Definition at line 534 of file exceptions.py.

◆ head

tuple head
static
Initial value:
= (
"Hashes are required in --require-hashes mode, but they are "
"missing from some requirements. Here is a list of those "
"requirements along with the hashes their downloaded archives "
"actually had. Add lines like these to your requirements files to "
"prevent tampering. (If you did not enable --require-hashes "
"manually, note that it turns on automatically when any package "
"has a hash.)"
)

Definition at line 519 of file exceptions.py.

◆ order

int order = 2
static

Definition at line 518 of file exceptions.py.

◆ req


The documentation for this class was generated from the following file: