@@ -105,7 +105,7 @@ def parse_pubkey_payload(data):
105105 ptr += 1
106106 if version_number not in SUPPORTED_PUBKEY_PACKET_VERSIONS :
107107 raise PacketVersionNotSupportedError (
108- "Pubkey packet version '{}' not supported, must be one of {}" .format ( # pylint: disable=consider-using-f-string
108+ "Pubkey packet version '{}' not supported, must be one of {}" .format (
109109 version_number , SUPPORTED_PUBKEY_PACKET_VERSIONS
110110 )
111111 )
@@ -130,7 +130,7 @@ def parse_pubkey_payload(data):
130130 # as described in section 5.2.3.21.
131131 if algorithm not in SUPPORTED_SIGNATURE_ALGORITHMS :
132132 raise SignatureAlgorithmNotSupportedError (
133- "Signature algorithm '{}' not " # pylint: disable=consider-using-f-string
133+ "Signature algorithm '{}' not "
134134 "supported, please verify that your gpg configuration is creating "
135135 "either DSA, RSA, or EdDSA signatures (see RFC4880 9.1. Public-Key "
136136 "Algorithms)." .format (algorithm )
@@ -216,7 +216,7 @@ def parse_pubkey_bundle(data):
216216 and not key_bundle [PACKET_TYPE_PRIMARY_KEY ]["key" ]
217217 ):
218218 raise PacketParsingError (
219- "First packet must be a primary key ('{}'), " # pylint: disable=consider-using-f-string
219+ "First packet must be a primary key ('{}'), "
220220 "got '{}'." .format (PACKET_TYPE_PRIMARY_KEY , packet_type )
221221 )
222222
@@ -282,7 +282,7 @@ def parse_pubkey_bundle(data):
282282
283283 else :
284284 log .info (
285- "Ignoring gpg key packet '{}', we only handle packets of " # pylint: disable=logging-format-interpolation,consider-using-f-string
285+ "Ignoring gpg key packet '{}', we only handle packets of "
286286 "types '{}' (see RFC4880 4.3. Packet Tags)." .format (
287287 packet_type ,
288288 [
@@ -297,8 +297,8 @@ def parse_pubkey_bundle(data):
297297
298298 # Both errors might be raised in parse_packet_header and in this loop
299299 except (PacketParsingError , IndexError ) as e :
300- raise PacketParsingError ( # pylint: disable=raise-missing-from
301- "Invalid public key data at position {}: {}." .format ( # pylint: disable=consider-using-f-string
300+ raise PacketParsingError (
301+ "Invalid public key data at position {}: {}." .format (
302302 position , e
303303 )
304304 )
@@ -369,15 +369,15 @@ def _assign_certified_key_info(bundle):
369369 # TODO: Revise exception taxonomy:
370370 # It's okay to ignore some exceptions (unsupported algorithms etc.) but
371371 # we should blow up if a signature is malformed (missing subpackets).
372- except Exception as e : # pylint: disable=broad-except
372+ except Exception as e :
373373 log .info (e )
374374 continue
375375
376376 if not bundle [PACKET_TYPE_PRIMARY_KEY ]["key" ]["keyid" ].endswith (
377377 signature ["keyid" ]
378378 ):
379379 log .info (
380- "Ignoring User ID certificate issued by '{}'." .format ( # pylint: disable=logging-format-interpolation,consider-using-f-string
380+ "Ignoring User ID certificate issued by '{}'." .format (
381381 signature ["keyid" ]
382382 )
383383 )
@@ -392,7 +392,7 @@ def _assign_certified_key_info(bundle):
392392
393393 if not is_valid :
394394 log .info (
395- "Ignoring invalid User ID self-certificate issued " # pylint: disable=logging-format-interpolation,consider-using-f-string
395+ "Ignoring invalid User ID self-certificate issued "
396396 "by '{}'." .format (signature ["keyid" ])
397397 )
398398 continue
@@ -493,7 +493,7 @@ def _get_verified_subkeys(bundle):
493493 )
494494
495495 # TODO: Revise exception taxonomy
496- except Exception as e : # pylint: disable=broad-except
496+ except Exception as e :
497497 log .info (e )
498498 continue
499499
@@ -523,7 +523,7 @@ def _get_verified_subkeys(bundle):
523523 key_binding_signatures .append (signature )
524524
525525 # TODO: Revise exception taxonomy
526- except Exception as e : # pylint: disable=broad-except
526+ except Exception as e :
527527 log .info (e )
528528 continue
529529 # NOTE: As per the V4 key structure diagram in RFC4880 section 12.1., a
@@ -535,7 +535,7 @@ def _get_verified_subkeys(bundle):
535535 # an *embedded primary key binding signature*.
536536 if len (key_binding_signatures ) != 1 :
537537 log .info (
538- "Ignoring subkey '{}' due to wrong amount of key binding " # pylint: disable=logging-format-interpolation,consider-using-f-string
538+ "Ignoring subkey '{}' due to wrong amount of key binding "
539539 "signatures ({}), must be exactly 1." .format (
540540 subkey ["keyid" ], len (key_binding_signatures )
541541 )
@@ -550,7 +550,7 @@ def _get_verified_subkeys(bundle):
550550
551551 if not is_valid :
552552 log .info (
553- "Ignoring subkey '{}' due to invalid key binding signature." .format ( # pylint: disable=logging-format-interpolation,consider-using-f-string
553+ "Ignoring subkey '{}' due to invalid key binding signature." .format (
554554 subkey ["keyid" ]
555555 )
556556 )
@@ -610,8 +610,9 @@ def get_pubkey_bundle(data, keyid):
610610 """
611611 if not data :
612612 raise KeyNotFoundError (
613- "Could not find gpg key '{}' in empty exported key " # pylint: disable=consider-using-f-string
614- "data." .format (keyid )
613+ "Could not find gpg key '{}' in empty exported key " "data." .format (
614+ keyid
615+ )
615616 )
616617
617618 # Parse out master key and subkeys (enriched and verified via certificates
@@ -631,7 +632,7 @@ def get_pubkey_bundle(data, keyid):
631632 if public_key and public_key ["keyid" ].endswith (keyid .lower ()):
632633 if idx > 1 :
633634 log .debug (
634- "Exporting master key '{}' including subkeys '{}' for" # pylint: disable=logging-format-interpolation,consider-using-f-string
635+ "Exporting master key '{}' including subkeys '{}' for"
635636 " passed keyid '{}'." .format (
636637 master_public_key ["keyid" ],
637638 ", " .join (list (sub_public_keys .keys ())),
@@ -642,9 +643,7 @@ def get_pubkey_bundle(data, keyid):
642643
643644 else :
644645 raise KeyNotFoundError (
645- "Could not find gpg key '{}' in exported key data." .format ( # pylint: disable=consider-using-f-string
646- keyid
647- )
646+ "Could not find gpg key '{}' in exported key data." .format (keyid )
648647 )
649648
650649 # Add subkeys dictionary to master pubkey "subkeys" field if subkeys exist
@@ -655,7 +654,7 @@ def get_pubkey_bundle(data, keyid):
655654
656655
657656# ruff: noqa: PLR0912, PLR0915
658- def parse_signature_packet ( # pylint: disable=too-many-locals,too-many-branches,too-many-statements
657+ def parse_signature_packet (
659658 data ,
660659 supported_signature_types = None ,
661660 supported_hash_algorithms = None ,
@@ -725,7 +724,7 @@ def parse_signature_packet( # pylint: disable=too-many-locals,too-many-branches
725724 ptr += 1
726725 if version_number not in SUPPORTED_SIGNATURE_PACKET_VERSIONS :
727726 raise ValueError (
728- "Signature version '{}' not supported, must be one of " # pylint: disable=consider-using-f-string
727+ "Signature version '{}' not supported, must be one of "
729728 "{}." .format (version_number , SUPPORTED_SIGNATURE_PACKET_VERSIONS )
730729 )
731730
@@ -738,7 +737,7 @@ def parse_signature_packet( # pylint: disable=too-many-locals,too-many-branches
738737
739738 if signature_type not in supported_signature_types :
740739 raise ValueError (
741- "Signature type '{}' not supported, must be one of {} " # pylint: disable=consider-using-f-string
740+ "Signature type '{}' not supported, must be one of {} "
742741 "(see RFC4880 5.2.1. Signature Types)." .format (
743742 signature_type , supported_signature_types
744743 )
@@ -749,7 +748,7 @@ def parse_signature_packet( # pylint: disable=too-many-locals,too-many-branches
749748
750749 if signature_algorithm not in SUPPORTED_SIGNATURE_ALGORITHMS :
751750 raise ValueError (
752- "Signature algorithm '{}' not " # pylint: disable=consider-using-f-string
751+ "Signature algorithm '{}' not "
753752 "supported, please verify that your gpg configuration is creating "
754753 "either DSA, RSA, or EdDSA signatures (see RFC4880 9.1. Public-Key "
755754 "Algorithms)." .format (signature_algorithm )
@@ -763,7 +762,7 @@ def parse_signature_packet( # pylint: disable=too-many-locals,too-many-branches
763762
764763 if hash_algorithm not in supported_hash_algorithms :
765764 raise ValueError (
766- "Hash algorithm '{}' not supported, must be one of {}" # pylint: disable=consider-using-f-string
765+ "Hash algorithm '{}' not supported, must be one of {}"
767766 " (see RFC4880 9.4. Hash Algorithms)." .format (
768767 hash_algorithm , supported_hash_algorithms
769768 )
@@ -863,7 +862,7 @@ def parse_signature_packet( # pylint: disable=too-many-locals,too-many-branches
863862 # Fail if keyid and short keyid are specified but don't match
864863 if keyid and not keyid .endswith (short_keyid ): # pragma: no cover
865864 raise ValueError (
866- "This signature packet seems to be corrupted. The key ID " # pylint: disable=consider-using-f-string
865+ "This signature packet seems to be corrupted. The key ID "
867866 "'{}' of the 'Issuer' subpacket must match the lower 64 bits of the "
868867 "fingerprint '{}' of the 'Issuer Fingerprint' subpacket (see RFC4880 "
869868 "and rfc4880bis-06 5.2.3.28. Issuer Fingerprint)." .format (
@@ -887,7 +886,7 @@ def parse_signature_packet( # pylint: disable=too-many-locals,too-many-branches
887886 signature = handler .get_signature_params (data [ptr :])
888887
889888 signature_data = {
890- "keyid" : "{}" .format (keyid ), # pylint: disable=consider-using-f-string
889+ "keyid" : "{}" .format (keyid ),
891890 "other_headers" : binascii .hexlify (data [:other_headers_ptr ]).decode (
892891 "ascii"
893892 ),
0 commit comments