f c@sUdZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl Z dddddd d d d d ddddddgZ dZ dZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Zd$Zd%Zd&Zd'Z d(Z!d)Z"d*Z#d+Z$d,Z%d-Z&d.Z'd/Z(d0Z)d1Z*d2Z+d3Z,d4Z-d5Z.d6Z/d7Z0d8Z1d9Z2d:Z3d;Z4d<Z5d=Z6d>Z7d?Z8d@Z9dAZ:dBZ;dCZ<dDZ=dEZ>dFZ?dGZ@dHZAdIZBdJZCdKZDdLZEdMZFdNZGi-dOd6dPd6dQd6dRd6dSd6dTd 6dUd!6dVd"6dWd#6dXd&6dYd'6dZd(6d[d)6d\d*6d]d+6d^d_6d`d,6dad-6dbd.6dcd/6ddd06ded16dfd26dgd36dhd46did56djd66dkd76dld86dmd96dnd:6dod;6dpd<6dqd=6drd>6dsdC6dtdD6dudE6dvdF6dwdG6dxdH6dydI6dzdJ6d{dK6d|dN6ZHd}ZId~ZJdZKejLdjMZNejLdjOZPGdddejQjRZSeSddZTeUZVGdddejWZXGdddZYyddlZZZWne[k r Yn$XGdddeYZ\e j]dGddde^Z_Gddde_Z`Gdd d e_ZaGddde_ZbGdd d e_ZcGdd d e_ZdGdd d e_ZeGdd d e_ZfGdddefZgGdddefZhGdddefZiGddde_ZjGddde_Zke_ZldS(u HTTP/1.1 client library HTTPConnection goes through a number of "states", which define when a client may legally make another request or fetch the response for a particular request. This diagram details these state transitions: (null) | | HTTPConnection() v Idle | | putrequest() v Request-started | | ( putheader() )* endheaders() v Request-sent | | response = getresponse() v Unread-response [Response-headers-read] |\____________________ | | | response.read() | putrequest() v v Idle Req-started-unread-response ______/| / | response.read() | | ( putheader() )* endheaders() v v Request-started Req-sent-unread-response | | response.read() v Request-sent This diagram presents the following rules: -- a second request may not be started until {response-headers-read} -- a response [object] cannot be retrieved until {request-sent} -- there is no differentiation between an unread response body and a partially read response body Note: this enforcement is applied by the HTTPConnection class. The HTTPResponse class does not enforce this state machine, which implies sophisticated clients may accelerate the request/response pipeline. Caution should be taken, though: accelerating the states beyond the above pattern may imply knowledge of the server's connection-close behavior for certain requests. For example, it is impossible to tell whether the server will close the connection UNTIL the response headers have been read; this means that further requests cannot be placed into the pipeline until it is known that the server will NOT be closing the connection. Logical State __state __response ------------- ------- ---------- Idle _CS_IDLE None Request-started _CS_REQ_STARTED None Request-sent _CS_REQ_SENT None Unread-response _CS_IDLE Req-started-unread-response _CS_REQ_STARTED Req-sent-unread-response _CS_REQ_SENT iN(uurlsplitu HTTPResponseuHTTPConnectionu HTTPExceptionu NotConnecteduUnknownProtocoluUnknownTransferEncodinguUnimplementedFileModeuIncompleteReadu InvalidURLuImproperConnectionStateuCannotSendRequestuCannotSendHeaderuResponseNotReadyu BadStatusLineuerroru responsesiPiuUNKNOWNuIdleuRequest-startedu Request-sentidieifiiiiiiiiii,i-i.i/i0i1i3iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiuContinueuSwitching ProtocolsuOKuCreateduAccepteduNon-Authoritative Informationu No Contentu Reset ContentuPartial ContentuMultiple ChoicesuMoved PermanentlyuFoundu See Otheru Not Modifiedu Use Proxyu(Unused)i2uTemporary Redirectu Bad Requestu UnauthorizeduPayment Requiredu Forbiddenu Not FounduMethod Not AlloweduNot AcceptableuProxy Authentication RequireduRequest TimeoutuConflictuGoneuLength RequireduPrecondition FaileduRequest Entity Too LargeuRequest-URI Too LonguUnsupported Media TypeuRequested Range Not SatisfiableuExpectation FaileduPrecondition RequireduToo Many RequestsuRequest Header Fields Too LargeuInternal Server ErroruNot Implementedu Bad GatewayuService UnavailableuGateway TimeoutuHTTP Version Not SupporteduNetwork Authentication Requirediis[^:\s][^:\r\n]*\Zs\n(?![ \t])|\r(?![ \t\n])cBs |EeZdZddZdS(u HTTPMessagecCs|jd}t|}g}d}xn|jD]`}|d|j|kr`d}n|ddjsd}n|r5|j|q5q5W|S(uFind all header lines matching a given header name. Look through the list of headers and find all lines matching a given header name (and their continuation lines). A list of the lines is returned, without interpretation. If the header does not occur, an empty list is returned. If the header occurs multiple times, all occurrences are returned. Case is not important in the header name. u:iNi(ulowerulenukeysuisspaceuappend(uselfunameunulstuhituline((u0/opt/alt/python33/lib64/python3.3/http/client.pyugetallmatchingheaderss    u!HTTPMessage.getallmatchingheadersN(u__name__u __module__u __qualname__ugetallmatchingheaders(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu HTTPMessagesu HTTPMessagecCsg}xy|jtd}t|tkr=tdn|j|t|tkrotdtn|d kr Pq q dj|jd}t j j d|j |S( uGParses only RFC2822 headers from a file pointer. email Parser wants to see strings rather than bytes. But a TextIOWrapper around self.rfile would buffer too many bytes from the stream, bytes which we later need to read as bytes. So we read the correct bytes here, as bytes, for email Parser to parse. iu header lineugot more than %d headerss s su iso-8859-1u_class(s s s( ureadlineu_MAXLINEulenu LineTooLonguappendu _MAXHEADERSu HTTPExceptionujoinudecodeuemailuparseruParseruparsestr(ufpu_classuheadersulineuhstring((u0/opt/alt/python33/lib64/python3.3/http/client.pyu parse_headerss   u parse_headerscsX|EeZdZded2d2ddZddZddZdd Zd d Z fd d Z fddZ ddZ ddZ d2fddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd2d&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1ZS(3u HTTPResponseicCs|jd|_||_|tk r=tjdtdn||_d|_ |_ t |_ t |_ t |_t |_t |_t |_t |_dS(Nurbuithe 'strict' argument isn't supported anymore; http.client now always assumes HTTP/1.x compliant servers.i(umakefileufpu debuglevelu_strict_sentineluwarningsuwarnuDeprecationWarningu_methoduNoneuheadersumsgu_UNKNOWNuversionustatusureasonuchunkedu chunk_leftulengthu will_close(uselfusocku debuglevelustrictumethoduurl((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__:s           uHTTPResponse.__init__cCsxt|jjtdd}t|tkr@tdn|jdkretdt|n|szt |ny|j dd\}}}WnOt k ry"|j dd\}}d}Wnt k rd}YnXYnX|j ds|jt |ny7t|}|d ks:|d krIt |nWnt k rjt |YnX|||fS( Niu iso-8859-1u status lineiureply:iuuHTTP/idi(ustrufpureadlineu_MAXLINEulenu LineTooLongu debugleveluprinturepru BadStatusLineusplituNoneu ValueErroru startswithu _close_connuint(uselfulineuversionustatusureason((u0/opt/alt/python33/lib64/python3.3/http/client.pyu _read_status\s2      uHTTPResponse._read_statuscCs|jdk rdSx|j\}}}|tkr;Pnxo|jjtd}t|tkrutdn|j }|sPn|j dkr>t d|q>q>q||_ |_ |j |_|dkrd|_n'|jdrd |_n t|t|j|_|_|j dkr`x'|jD]}t d|d d q@Wn|jjd }|r|jd krd|_d|_n d|_|j|_d|_|jjd}|jjd }|rC|j rCyt||_Wntk r$d|_YqLX|jdkrLd|_qLn d|_|tks|t ksd|ko{dkns|j!dkrd|_n|j r|j r|jdkrd|_ndS(Niu header lineiuheader:uHTTP/1.0uHTTP/0.9i uHTTP/1.i uendu utransfer-encodinguchunkeducontent-lengthidiuHEAD(uHTTP/1.0uHTTP/0.9TF("uheadersuNoneu _read_statusuCONTINUEufpureadlineu_MAXLINEulenu LineTooLongustripu debugleveluprintucodeustatusureasonuversionu startswithuUnknownProtocolu parse_headersumsgugetuloweruTrueuchunkedu chunk_leftuFalseu _check_closeu will_closeulengthuintu ValueErroru NO_CONTENTu NOT_MODIFIEDu_method(uselfuversionustatusureasonuskipuhdrutr_enculength((u0/opt/alt/python33/lib64/python3.3/http/client.pyubegin|sf               uHTTPResponse.begincCs|jjd}|jdkrS|jjd}|rOd|jkrOdSdS|jjdridS|rd|jkrdS|jjd}|rd|jkrdSdS(Nu connectioni ucloseu keep-aliveuproxy-connectionTF(uheadersugetuversionuloweruTrueuFalse(uselfuconnupconn((u0/opt/alt/python33/lib64/python3.3/http/client.pyu _check_closesuHTTPResponse._check_closecCs |j}d|_|jdS(N(ufpuNoneuclose(uselfufp((u0/opt/alt/python33/lib64/python3.3/http/client.pyu _close_conns  uHTTPResponse._close_conncs'tj|jr#|jndS(N(usuperucloseufpu _close_conn(uself(u __class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyucloses  uHTTPResponse.closecs*tj|jr&|jjndS(N(usuperuflushufp(uself(u __class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyuflushs  uHTTPResponse.flushcCsdS(NT(uTrue(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyureadablesuHTTPResponse.readablecCs |jdkS(u!True if the connection is closed.N(ufpuNone(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyuisclosedsuHTTPResponse.isclosedc s|jdkrdS|jdkr0|jdS|dk rRtt|j|S|jre|jS|j dkr|jj}nAy|j |j }Wnt k r|jYnXd|_ |j|SdS(NsuHEADi( ufpuNoneu_methodu _close_connusuperu HTTPResponseureaduchunkedu_readall_chunkedulengthu _safe_readuIncompleteRead(uselfuamtus(u __class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyuread s&        uHTTPResponse.readcCs|jdkrdS|jdkr0|jdS|jrF|j|S|jdk rt||jkrt|d|j}qn|jj |}| r|r|jn7|jdk r|j|8_|js|jqn|S(NiuHEAD( ufpuNoneu_methodu _close_connuchunkedu_readinto_chunkedulengthulenu memoryviewureadinto(uselfubun((u0/opt/alt/python33/lib64/python3.3/http/client.pyureadinto,s$      uHTTPResponse.readintoc Cs|jjtd}t|tkr7tdn|jd}|dkre|d|}nyt|dSWntk r|jYnXdS(Niu chunk sizes;ii( ufpureadlineu_MAXLINEulenu LineTooLongufinduintu ValueErroru _close_conn(uselfulineui((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_read_next_chunk_sizeJs   u"HTTPResponse._read_next_chunk_sizecCs[xT|jjtd}t|tkr:tdn|sDPn|dkrPqqdS(Niu trailer lines s s(s s s(ufpureadlineu_MAXLINEulenu LineTooLong(uselfuline((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_read_and_discard_trailerZs u&HTTPResponse._read_and_discard_trailerc Cs|jtkst|j}g}x|dkry |j}|dkrRPnWqtk r|tdj|YqXn|j |j ||j dd}q'|j |j dj|S(Nisi( uchunkedu_UNKNOWNuAssertionErroru chunk_leftuNoneu_read_next_chunk_sizeu ValueErroruIncompleteReadujoinuappendu _safe_readu_read_and_discard_traileru _close_conn(uselfu chunk_leftuvalue((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_readall_chunkedhs"         uHTTPResponse._readall_chunkedc Cso|jtkst|j}d}t|}x$|dkry |j}|dkr^PnWqtk rtt |d|YqXnt ||kr|j |}|||_||St ||kr|j |}|j dd|_||S|d|}|j |}||d}||7}|j dd}q3|j |j|S(Nii(uchunkedu_UNKNOWNuAssertionErroru chunk_leftu memoryviewuNoneu_read_next_chunk_sizeu ValueErroruIncompleteReadubytesulenu_safe_readintou _safe_readu_read_and_discard_traileru _close_conn(uselfubu chunk_leftu total_bytesumvbunutemp_mvb((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_readinto_chunkeds<      $        uHTTPResponse._readinto_chunkedcCsg}xi|dkrq|jjt|t}|sQtdj||n|j||t|8}q Wdj|S(uVRead the number of bytes requested, compensating for partial reads. Normally, we have a blocking socket, but a read() can be interrupted by a signal (resulting in a partial read). Note that we cannot distinguish between EOF and an interrupt when zero bytes have been read. IncompleteRead() will be raised in this situation. This function should be used when bytes "should" be present for reading. If the bytes are truly not available (due to EOF), then the IncompleteRead exception can be used to detect the problem. is(ufpureaduminu MAXAMOUNTuIncompleteReadujoinuappendulen(uselfuamtusuchunk((u0/opt/alt/python33/lib64/python3.3/http/client.pyu _safe_reads uHTTPResponse._safe_readcCsd}t|}x|t|krtt|kr^|dt}|jj|}n|jj|}|stt|d|t|n||d}||7}qW|S(u2Same as _safe_read, but for reading into a buffer.iN(u memoryviewulenu MAXAMOUNTufpureadintouIncompleteReadubytes(uselfubu total_bytesumvbutemp_mvbun((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_safe_readintos (uHTTPResponse._safe_readintocCs |jjS(N(ufpufileno(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyufilenosuHTTPResponse.filenocCsg|jdkrtn|jj|p0|}t|tsRt|d rV|Sdj|SdS(Nu__iter__u, (uheadersuNoneuResponseNotReadyuget_allu isinstanceustruhasattrujoin(uselfunameudefaultuheaders((u0/opt/alt/python33/lib64/python3.3/http/client.pyu getheaders  uHTTPResponse.getheadercCs.|jdkrtnt|jjS(u&Return list of (header, value) tuples.N(uheadersuNoneuResponseNotReadyulistuitems(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyu getheaderss uHTTPResponse.getheaderscCs|S(N((uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__iter__suHTTPResponse.__iter__cCs|jS(N(uheaders(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyuinfosuHTTPResponse.infocCs|jS(N(uurl(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyugeturlsuHTTPResponse.geturlcCs|jS(N(ustatus(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyugetcodesuHTTPResponse.getcodeN(u__name__u __module__u __qualname__u_strict_sentineluNoneu__init__u _read_statusubeginu _check_closeu _close_connucloseuflushureadableuisclosedureadureadintou_read_next_chunk_sizeu_read_and_discard_traileru_readall_chunkedu_readinto_chunkedu _safe_readu_safe_readintoufilenou getheaderu getheadersu__iter__uinfougeturlugetcode(u __locals__((u __class__u0/opt/alt/python33/lib64/python3.3/http/client.pyu HTTPResponse1s0 " P          )       cBs+|EeZdZdZdZeZeZdZ dZ d'e e jd'ddZd'd'ddZd d Zd d Zd dZddZddZddZddZd'ddZddddZddZd'ddZd'idd Zd!d"Zd#d$Zd%d&Zd'S((uHTTPConnectioni uHTTP/1.1iicCs|tk r"tjdtdn||_||_d|_g|_d|_ t |_ d|_ d|_ d|_i|_|j||dS(Nuithe 'strict' argument isn't supported anymore; http.client now always assumes HTTP/1.x compliant servers.i(u_strict_sentineluwarningsuwarnuDeprecationWarningutimeoutusource_addressuNoneusocku_bufferu_HTTPConnection__responseu_CS_IDLEu_HTTPConnection__stateu_methodu _tunnel_hostu _tunnel_portu_tunnel_headersu _set_hostport(uselfuhostuportustrictutimeoutusource_address((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__s             uHTTPConnection.__init__cCs5||_||_|r$||_n |jjdS(u Sets up the host and the port for the HTTP CONNECT Tunnelling. The headers argument should be a mapping of extra HTTP headers to send with the CONNECT request. N(u _tunnel_hostu _tunnel_portu_tunnel_headersuclear(uselfuhostuportuheaders((u0/opt/alt/python33/lib64/python3.3/http/client.pyu set_tunnels    uHTTPConnection.set_tunnelc Cs|dkr|jd}|jd}||kryt||dd}WnVtk r||dddkr|j}ntd||ddYnX|d|}n |j}|r|ddkr|ddkr|dd }qn||_||_dS( Nu:u]iuunonnumeric port: '%s'iu[ii(uNoneurfinduintu ValueErroru default_portu InvalidURLuhostuport(uselfuhostuportuiuj((u0/opt/alt/python33/lib64/python3.3/http/client.pyu _set_hostports     # & uHTTPConnection._set_hostportcCs ||_dS(N(u debuglevel(uselfulevel((u0/opt/alt/python33/lib64/python3.3/http/client.pyuset_debuglevel1suHTTPConnection.set_debuglevelc Csd|j|j|jd|j|jf}|jd}|j|xI|jjD]8\}}d||f}|jd}|j|qXW|jd|j |j d|j }|j \}} } | dkr |j tjd| | jfnxT|jjtd } t| tkrCtd n| sMPn| d kr Pq q dS(NuCONNECT %s:%d HTTP/1.0 uasciiu%s: %s ulatin-1s umethodiuTunnel connection failed: %d %siu header lines s(s s s(u _set_hostportu _tunnel_hostu _tunnel_portuhostuportuencodeusendu_tunnel_headersuitemsuresponse_classusocku_methodu _read_statusucloseusocketuerrorustripufpureadlineu_MAXLINEulenu LineTooLong( uselfu connect_stru connect_bytesuheaderuvalueu header_stru header_bytesuresponseuversionucodeumessageuline((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_tunnel4s.      uHTTPConnection._tunnelcCsDtj|j|jf|j|j|_|jr@|jndS(u3Connect to the host and port specified in __init__.N( usocketucreate_connectionuhostuportutimeoutusource_addressusocku _tunnel_hostu_tunnel(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyuconnectPs uHTTPConnection.connectcCsQ|jr"|jjd|_n|jrD|jjd|_nt|_dS(u(Close the connection to the HTTP server.N(usockucloseuNoneu_HTTPConnection__responseu_CS_IDLEu_HTTPConnection__state(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyucloseWs      uHTTPConnection.closecCs|jd kr1|jr%|jq1tn|jdkrVtdt|nd}t|dr+|jdkrtdnd }y |j }Wnt k rYn2Xd|krd }|jdkrtdqnxD|j |}|sPn|r|jd}n|jj|qd Sy|jj|Wn^tk rt|tjrx7|D]}|jj|qhWntd t|YnXd S( uSend `data' to the server. ``data`` can be a string object, a bytes object, an array object, a file-like object that supports a .read() method, or an iterable object. iusend:i ureadusendIng a read()ableubuencoding file using iso-8859-1u iso-8859-1Nu9data should be a bytes-like object or an iterable, got %rFT(usockuNoneu auto_openuconnectu NotConnectedu debugleveluprinturepruhasattruFalseumodeuAttributeErroruTrueureaduencodeusendallu TypeErroru isinstanceu collectionsuIterableutype(uselfudatau blocksizeuencodeumodeu datablockud((u0/opt/alt/python33/lib64/python3.3/http/client.pyusendasF         uHTTPConnection.sendcCs|jj|dS(uuAdd a line of output to the current request buffer. Assumes that the line does *not* end with \r\n. N(u_bufferuappend(uselfus((u0/opt/alt/python33/lib64/python3.3/http/client.pyu_outputsuHTTPConnection._outputcCs|jjddj|j}|jdd=t|trT||7}d}n|j||dk r}|j|ndS(uSend the currently buffered request and clear the buffer. Appends an extra \r\n to the buffer. A message_body may be specified, to be appended to the request. ss N(ss(u_bufferuextendujoinu isinstanceubytesuNoneusend(uselfu message_bodyumsg((u0/opt/alt/python33/lib64/python3.3/http/client.pyu _send_outputs    uHTTPConnection._send_outputc Cs|jr$|jjr$d|_n|jtkr?t|_nt|j||_|sfd}nd|||jf}|j |j d|j dkr|sd}|j drt |\}}}}}n|r*y|j d}Wn!tk r|j d}YnX|jd|qy|jj d} Wn$tk rf|jj d} YnX|jjd d krd | d } n|j|jkr|jd| q| jd} |jdd | |jfn|s|jddqndS(u`Send a request to the server. `method' specifies an HTTP request method, e.g. 'GET'. `url' specifies the object being requested, e.g. '/index.html'. `skip_host' if True does not add automatically a 'Host:' header `skip_accept_encoding' if True does not add automatically an 'Accept-Encoding:' header u/u%s %s %suasciii uuhttpuidnauHostu:is[s]u%s:%suAccept-EncodinguidentityN(u_HTTPConnection__responseuiscloseduNoneu_HTTPConnection__stateu_CS_IDLEu_CS_REQ_STARTEDuCannotSendRequestu_methodu _http_vsn_stru_outputuencodeu _http_vsnu startswithuurlsplituUnicodeEncodeErroru putheaderuhostufinduportu default_portudecode( uselfumethoduurlu skip_hostuskip_accept_encodingurequestunetlocunilu netloc_encuhost_enc((u0/opt/alt/python33/lib64/python3.3/http/client.pyu putrequestsD         uHTTPConnection.putrequestcGs/|jtkrtnt|dr<|jd}nt|s^td|fnt|}xt|D]\}}t|dr|jd||cs u0HTTPConnection._send_request..uhostiu skip_hostuaccept-encodinguskip_accept_encodingucontent-lengthu iso-8859-1( udictufromkeysu putrequestuNoneu_set_content_lengthuitemsu putheaderu isinstanceustruencodeu endheaders( uselfumethoduurlubodyuheadersu header_namesuskipsuhdruvalue((u0/opt/alt/python33/lib64/python3.3/http/client.pyu _send_requestas    uHTTPConnection._send_requestcCs|jr$|jjr$d|_n|jtks<|jrNt|jn|jdkr|j|j|jd|j }n|j|jd|j }|j |j t kst t|_|j r|jn ||_|S(u/Get the response from the server. If the HTTPConnection is in the correct state, returns an instance of HTTPResponse or of whatever object is returned by class the response_class variable. If a request has not been sent or if a previous response has not be handled, ResponseNotReady is raised. If the HTTP response indicates that the connection should be closed, then it will be closed before the response is returned. When the connection is closed, the underlying socket is closed. iumethodN(u_HTTPConnection__responseuiscloseduNoneu_HTTPConnection__stateu _CS_REQ_SENTuResponseNotReadyu debugleveluresponse_classusocku_methodubeginu will_closeu_UNKNOWNuAssertionErroru_CS_IDLEuclose(uselfuresponse((u0/opt/alt/python33/lib64/python3.3/http/client.pyu getresponsevs      uHTTPConnection.getresponseN( u__name__u __module__u __qualname__u _http_vsnu _http_vsn_stru HTTPResponseuresponse_classu HTTP_PORTu default_portu auto_openu debugleveluNoneu_strict_sentinelusocketu_GLOBAL_DEFAULT_TIMEOUTu__init__u set_tunnelu _set_hostportuset_debuglevelu_tunneluconnectucloseusendu_outputu _send_outputu putrequestu putheaderu endheadersurequestu_set_content_lengthu _send_requestu getresponse(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuHTTPConnections0     0 t   c s_|EeZdZdZeZdddddddeej dfddZ ddZ S( uHTTPSConnectionu(This class allows communication via SSL.ucontextucheck_hostnamec stt|j|||||||_||_|dkrgtjtj}|j tj O_ n|j tj k} | dkr| } n| r| rt dn|s|r|j||n||_| |_dS(NuMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED(usuperuHTTPSConnectionu__init__ukey_fileu cert_fileuNoneusslu SSLContextuPROTOCOL_SSLv23uoptionsu OP_NO_SSLv2u verify_modeu CERT_NONEu ValueErroruload_cert_chainu_contextu_check_hostname( uselfuhostuportukey_fileu cert_fileustrictutimeoutusource_addressucontextucheck_hostnameu will_verify(u __class__(u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__s         uHTTPSConnection.__init__c Cstj|j|jf|j|j}|jrF||_|jnt j rX|jnd}|j j |d||_y,|jrt j|jj|jnWn5tk r|jjtj|jjYnXdS(u(Connect to a host on a given (SSL) port.userver_hostnameN(usocketucreate_connectionuhostuportutimeoutusource_addressu _tunnel_hostusocku_tunnelussluHAS_SNIuNoneu_contextu wrap_socketu_check_hostnameumatch_hostnameu getpeercertu Exceptionushutdownu SHUT_RDWRuclose(uselfusockuserver_hostname((u0/opt/alt/python33/lib64/python3.3/http/client.pyuconnects     #  uHTTPSConnection.connectN( u__name__u __module__u __qualname__u__doc__u HTTPS_PORTu default_portuNoneu_strict_sentinelusocketu_GLOBAL_DEFAULT_TIMEOUTu__init__uconnect(u __locals__((u __class__u0/opt/alt/python33/lib64/python3.3/http/client.pyuHTTPSConnections 0uHTTPSConnectioncBs|EeZdZdS(u HTTPExceptionN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu HTTPExceptionscBs|EeZdZdS(u NotConnectedN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu NotConnectedscBs|EeZdZdS(u InvalidURLN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu InvalidURLscBs |EeZdZddZdS(uUnknownProtocolcCs|f|_||_dS(N(uargsuversion(uselfuversion((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__s uUnknownProtocol.__init__N(u__name__u __module__u __qualname__u__init__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuUnknownProtocolscBs|EeZdZdS(uUnknownTransferEncodingN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuUnknownTransferEncodingscBs|EeZdZdS(uUnimplementedFileModeN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuUnimplementedFileModescBs;|EeZdZdddZddZddZdS(uIncompleteReadcCs"|f|_||_||_dS(N(uargsupartialuexpected(uselfupartialuexpected((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__s  uIncompleteRead.__init__cCs<|jdk rd|j}nd}dt|j|fS(Nu, %i more expecteduuIncompleteRead(%i bytes read%s)(uexpecteduNoneulenupartial(uselfue((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__repr__suIncompleteRead.__repr__cCs t|S(N(urepr(uself((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__str__suIncompleteRead.__str__N(u__name__u __module__u __qualname__uNoneu__init__u__repr__u__str__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuIncompleteReads cBs|EeZdZdS(uImproperConnectionStateN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuImproperConnectionState scBs|EeZdZdS(uCannotSendRequestN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuCannotSendRequest scBs|EeZdZdS(uCannotSendHeaderN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuCannotSendHeaderscBs|EeZdZdS(uResponseNotReadyN(u__name__u __module__u __qualname__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyuResponseNotReadyscBs |EeZdZddZdS(u BadStatusLinecCs.|st|}n|f|_||_dS(N(urepruargsuline(uselfuline((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__s uBadStatusLine.__init__N(u__name__u __module__u __qualname__u__init__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu BadStatusLinescBs |EeZdZddZdS(u LineTooLongcCstj|dt|fdS(Nu&got more than %d bytes when reading %s(u HTTPExceptionu__init__u_MAXLINE(uselfu line_type((u0/opt/alt/python33/lib64/python3.3/http/client.pyu__init__s uLineTooLong.__init__N(u__name__u __module__u __qualname__u__init__(u __locals__((u0/opt/alt/python33/lib64/python3.3/http/client.pyu LineTooLongsu LineTooLong(mu__doc__u email.parseruemailu email.messageuiouosureusocketu collectionsu urllib.parseuurlsplituwarningsu__all__u HTTP_PORTu HTTPS_PORTu_UNKNOWNu_CS_IDLEu_CS_REQ_STARTEDu _CS_REQ_SENTuCONTINUEuSWITCHING_PROTOCOLSu PROCESSINGuOKuCREATEDuACCEPTEDuNON_AUTHORITATIVE_INFORMATIONu NO_CONTENTu RESET_CONTENTuPARTIAL_CONTENTu MULTI_STATUSuIM_USEDuMULTIPLE_CHOICESuMOVED_PERMANENTLYuFOUNDu SEE_OTHERu NOT_MODIFIEDu USE_PROXYuTEMPORARY_REDIRECTu BAD_REQUESTu UNAUTHORIZEDuPAYMENT_REQUIREDu FORBIDDENu NOT_FOUNDuMETHOD_NOT_ALLOWEDuNOT_ACCEPTABLEuPROXY_AUTHENTICATION_REQUIREDuREQUEST_TIMEOUTuCONFLICTuGONEuLENGTH_REQUIREDuPRECONDITION_FAILEDuREQUEST_ENTITY_TOO_LARGEuREQUEST_URI_TOO_LONGuUNSUPPORTED_MEDIA_TYPEuREQUESTED_RANGE_NOT_SATISFIABLEuEXPECTATION_FAILEDuUNPROCESSABLE_ENTITYuLOCKEDuFAILED_DEPENDENCYuUPGRADE_REQUIREDuPRECONDITION_REQUIREDuTOO_MANY_REQUESTSuREQUEST_HEADER_FIELDS_TOO_LARGEuINTERNAL_SERVER_ERRORuNOT_IMPLEMENTEDu BAD_GATEWAYuSERVICE_UNAVAILABLEuGATEWAY_TIMEOUTuHTTP_VERSION_NOT_SUPPORTEDuINSUFFICIENT_STORAGEu NOT_EXTENDEDuNETWORK_AUTHENTICATION_REQUIREDu responsesu MAXAMOUNTu_MAXLINEu _MAXHEADERSucompileumatchu_is_legal_header_nameusearchu_is_illegal_header_valueumessageuMessageu HTTPMessageu parse_headersuobjectu_strict_sentinelu RawIOBaseu HTTPResponseuHTTPConnectionusslu ImportErroruHTTPSConnectionuappendu Exceptionu HTTPExceptionu NotConnectedu InvalidURLuUnknownProtocoluUnknownTransferEncodinguUnimplementedFileModeuIncompleteReaduImproperConnectionStateuCannotSendRequestuCannotSendHeaderuResponseNotReadyu BadStatusLineu LineTooLonguerror(((u0/opt/alt/python33/lib64/python3.3/http/client.pyuCs0              2