,RddlmZddlmZddlmZmZddlm Z dd Z ddZ ddZ dS)) annotationsN)!MultipartInvariantViolationDefectStartBoundaryNotFoundDefect)HeaderParsingErrorobjobjectreturnboolc |S#t$rYnwxYw |jS#t$rYnwxYw |jduS#t$rYnwxYwt d)zt Checks whether a given file-like object is closed. :param obj: The file-like object to check. Nz)Unable to determine whether fp is closed.)isclosedAttributeErrorclosedfp ValueError)rs /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/urllib3/util/response.py is_fp_closedr s ||~~       z       v~       @ A AAs) ##. ;;A AAheadershttplib.HTTPMessageNonecVt|tjs tdt |dd}|s2|}t|ttfr|}d|j D}|s|rt||dS)a> Asserts whether all headers have been successfully parsed. Extracts encountered errors from the result of parsing headers. Only works on Python 3. :param http.client.HTTPMessage headers: Headers to verify. :raises urllib3.exceptions.HeaderParsingError: If parsing errors are found. zexpected httplib.Message, got .NcJg|] }t|ttf|!S) isinstancerr).0defects r z)assert_header_parsing..OsD  02ST  )defects unparsed_data) rhttplib HTTPMessage TypeErrortype is_multipart get_payloadbytesstrr r)rr!payloadr s rassert_header_parsingr+(s gw2 3 3KIgIIIJJJM    ! !$%%'' gs| , , $#MoGO-O  NNNNOOrresponsehttplib.HTTPResponsec@|j}|dkS)z Checks whether the request of a response has been a HEAD-request. :param http.client.HTTPResponse response: Response to check if the originating request used 'HEAD' as a method. HEAD)_methodupper)r, method_strs ris_response_to_headr3[s#!J      ''r)rr r r )rrr r)r,r-r r ) __future__r http.clientclientr" email.errorsrr exceptionsrrr+r3rrrr9s""""""WWWWWWWW++++++BBBB>0O0O0O0Of ( ( ( ( ( (r