MCPcopy Index your code
hub / github.com/python/cpython / parse_openssl_error_text

Function parse_openssl_error_text

Tools/ssl/make_ssl_data.py:128–145  ·  view source on GitHub ↗

Parse error reasons from crypto/err/openssl.txt. Detected lines match " _R_ : : ", e.g., "ASN1_R_ADDING_OBJECT:171:adding object". The part is not stored as it will be recovered at runtime when needed.

(args)

Source from the content-addressed store, hash-verified

126
127
128def parse_openssl_error_text(args):
129 """Parse error reasons from crypto/err/openssl.txt.
130
131 Detected lines match "<LIBNAME>_R_<ERRNAME>:<ERRCODE>:<MESSAGE>",
132 e.g., "ASN1_R_ADDING_OBJECT:171:adding object". The <MESSAGE> part
133 is not stored as it will be recovered at runtime when needed.
134 """
135 # ignore backslash line continuation (placed before <MESSAGE> if present)
136 pat = re.compile(r"^((\w+?)_R_(\w+)):(\d+):")
137 seen = {}
138 for match in _file_search(args.errtxt, pat):
139 reason, libname, errname, num = match.groups()
140 if "_F_" in reason: # ignore function codes
141 # FEAT(picnixz): in the future, we may want to also check
142 # the consistency of the OpenSSL files with an external tool.
143 # See https://github.com/python/cpython/issues/132745.
144 continue
145 yield reason, libname, errname, int(num)
146
147
148def parse_extra_reasons(args):

Callers 1

mainFunction · 0.85

Calls 3

_file_searchFunction · 0.85
compileMethod · 0.45
groupsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…