CYh. PddlmZddlmZddlmZmZddlm Z d dZ d dZ d dZ y) ) annotationsN)!MultipartInvariantViolationDefectStartBoundaryNotFoundDefect)HeaderParsingErrorc |jS#t$rYnwxYw |jS#t$rYnwxYw |jduS#t$r Yt dwxYw)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)objs 7/usr/lib/python3/dist-packages/urllib3/util/response.py is_fp_closedr s{ ||~     zz     vv~   @ AA s)  . :: A A"!A"cft|tjstdt |dd}|j s(|j }t|ttfr|}|jDcgc]}t|ttfs|}}|s|r t||ycc}w)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 .N)defects unparsed_data) isinstancehttplib HTTPMessage TypeErrortype is_multipart get_payloadbytesstrrrrr)headersrpayloaddefectrs rassert_header_parsingr!(s gw22 38gqIJJM    !%%' gs| ,#Moo  02ST  G-  NN s;B.c@|j}|jdk(S)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)response method_strs ris_response_to_headr([s#!!J     '')robjectreturnbool)rzhttplib.HTTPMessager+None)r&zhttplib.HTTPResponser+r,) __future__r http.clientclientr email.errorsrr exceptionsrrr!r(r)rr4s#"W+B>0Of (r)