1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
U
Þ=®dáqã@sèddlmZddlZddlZddlZddlZddlmZddlm    Z    ddl
m Z ddl m Z ddl mZdd    l mZdd
lmZdd lmZdd lmZdd lmZejrÂddlmZddlmZdddœdd„ZdMdddddddœdd„Zdddœdd „ZdNdddd!œd"d#„Zdd$dœd%d&„Z dOddd$d(d)œd*d+„Z!dPdd-d.dd/œd0d1„Z"Gd2d3„d3ƒZ#dQdd(d5d6d7œd8d9„Z$Gd:d;„d;ƒZ%Gd<d=„d=ƒZ&d>d$d5d?d@œdAdB„Z'dRd>d$d5dd?dDœdEdF„Z(dSd>dGd$d5dd?dHœdIdJ„Z)GdKdL„dLej*ƒZ+dS)Té)Ú annotationsN)Úpartial©Úupdate_wrapper)Úchainé)Ú_make_encode_wrapper)Ú    _to_bytes)Ú_to_str)ÚClientDisconnected)ÚRequestEntityTooLarge)Úutils)Úhost_is_trusted)ÚWSGIApplication)ÚWSGIEnvironmentz t.Callable[..., WSGIApplication]r)ÚfÚreturncst‡fdd„ˆƒS)a
Marks a function as responder.  Decorate a function with it and it
    will automatically call the return value as WSGI application.
 
    Example::
 
        @responder
        def application(environ, start_response):
            return Response('Hello World!')
    csˆ|Ž|dd…ŽS)Néþÿÿÿ©)Úa©rrúDd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\werkzeug/wsgi.pyÚ<lambda>"ózresponder.<locals>.<lambda>rrrrrÚ    responders
rFrÚboolzt.Iterable[str] | NoneÚstr)ÚenvironÚ    root_onlyÚstrip_querystringÚ    host_onlyÚ trusted_hostsrcCsb|dt||ƒdœ}|sV| dd¡|d<|sV| dd¡|d<|sV| dd¡ d    ¡|d
<tjf|ŽS) aXRecreate the URL for a request from the parts in a WSGI
    environment.
 
    The URL is an IRI, not a URI, so it may contain Unicode characters.
    Use :func:`~werkzeug.urls.iri_to_uri` to convert it to ASCII.
 
    :param environ: The WSGI environment to get the URL parts from.
    :param root_only: Only build the root path, don't include the
        remaining path or query string.
    :param strip_querystring: Don't include the query string.
    :param host_only: Only build the scheme and host.
    :param trusted_hosts: A list of trusted host names to validate the
        host against.
    úwsgi.url_scheme)ÚschemeÚhostZ SCRIPT_NAMEÚÚ    root_pathÚ    PATH_INFOÚpathÚ QUERY_STRINGÚlatin1Z query_string)Úget_hostÚgetÚencodeÚ _sansio_utilsÚget_current_url)rrrr r!Úpartsrrrr/%sþr/ztuple[str, int | None] | None)rrc    CsP| d¡}|dkrdSzt| dd¡ƒ}Wnttfk
rFd}YnX||fS)NZ SERVER_NAMEZ SERVER_PORT)r,ÚintÚ    TypeErrorÚ
ValueError)rÚnameÚportrrrÚ _get_serverKs
 
r6)rr!rcCst |d| d¡t|ƒ|¡S)arReturn the host for the given WSGI environment.
 
    The ``Host`` header is preferred, then ``SERVER_NAME`` if it's not
    set. The returned host will only contain the port if it is different
    than the standard port for the protocol.
 
    Optionally, verify that the host is trusted using
    :func:`host_is_trusted` and raise a
    :exc:`~werkzeug.exceptions.SecurityError` if it is not.
 
    :param environ: A WSGI environment dict.
    :param trusted_hosts: A list of trusted host names.
 
    :return: Host, with port if necessary.
    :raise ~werkzeug.exceptions.SecurityError: If the host is not
        trusted.
    r"Z    HTTP_HOST)r.r+r,r6)rr!rrrr+\s ür+ú
int | NonecCstj| d¡| d¡dS)adReturn the ``Content-Length`` header value as an int. If the header is not given
    or the ``Transfer-Encoding`` header is ``chunked``, ``None`` is returned to indicate
    a streaming request. If the value is not an integer, or negative, 0 is returned.
 
    :param environ: The WSGI environ to get the content length from.
 
    .. versionadded:: 0.9
    ÚCONTENT_LENGTHZHTTP_TRANSFER_ENCODING)Zhttp_content_lengthZhttp_transfer_encoding)r.Úget_content_lengthr,)rrrrr9xs    þr9Tú t.IO[bytes])rÚ safe_fallbackÚmax_content_lengthrcCsœt tjt|d¡}t|ƒ}|dk    r<|dk    r<||kr<tƒ‚d|krl|dk    rht tjtt||dd¡S|S|dkr„|r€t ¡S|St tjtt||ƒ¡S)a¸Return the WSGI input stream, wrapped so that it may be read safely without going
    past the ``Content-Length`` header value or ``max_content_length``.
 
    If ``Content-Length`` exceeds ``max_content_length``, a
    :exc:`RequestEntityTooLarge`` ``413 Content Too Large`` error is raised.
 
    If the WSGI server sets ``environ["wsgi.input_terminated"]``, it indicates that the
    server handles terminating the stream, so it is safe to read directly. For example,
    a server that knows how to handle chunked requests safely would set this.
 
    If ``max_content_length`` is set, it can be enforced on streams if
    ``wsgi.input_terminated`` is set. Otherwise, an empty stream is returned unless the
    user explicitly disables this safe fallback.
 
    If the limit is reached before the underlying stream is exhausted (such as a file
    that is too large, or an infinite stream), the remaining contents of the stream
    cannot be read safely. Depending on how the server handles this, clients may show a
    "connection reset" failure instead of seeing the 413 response.
 
    :param environ: The WSGI environ containing the stream.
    :param safe_fallback: Return an empty stream when ``Content-Length`` is not set.
        Disabling this allows infinite streams, which can be a denial-of-service risk.
    :param max_content_length: The maximum length that content-length or streaming
        requests may not exceed.
 
    .. versionchanged:: 2.3.2
        ``max_content_length`` is only applied to streaming requests if the server sets
        ``wsgi.input_terminated``.
 
    .. versionchanged:: 2.3
        Check ``max_content_length`` and raise an error if it is exceeded.
 
    .. versionadded:: 0.9
    z
wsgi.inputNzwsgi.input_terminatedT)Úis_max)    ÚtÚcastÚIOÚbytesr9r Ú LimitedStreamÚioÚBytesIO)rr;r<ÚstreamÚcontent_lengthrrrÚget_input_stream‡s' ÿrG.út.Anyz
str | None)rÚcharsetÚerrorsrcCsf|dk    r&tjdtdd|dkr*d}nd}|dk    rDtjdtddnd}| d    d
¡ d ¡}| ||¡S) aReturn ``PATH_INFO`` from  the WSGI environment.
 
    :param environ: WSGI environment to get the path from.
 
    .. versionchanged:: 2.3
        The ``charset`` and ``errors`` parameters are deprecated and will be removed in
        Werkzeug 3.0.
 
    .. versionadded:: 0.9
    .zJThe 'charset' parameter is deprecated and will be removed in Werkzeug 3.0.é©Ú
stacklevelNzutf-8zHThe 'errors' parameter is deprecated and will be removed in Werkzeug 3.0Úreplacer'r%r*)ÚwarningsÚwarnÚDeprecationWarningr,r-Údecode)rrIrJr(rrrÚ get_path_infoËs$üýrSc@sNeZdZdZdddddœdd„Zdd    œd
d „Zd d    œd d„Zdd    œdd„ZdS)ÚClosingIteratoraAThe WSGI specification requires that all middlewares and gateways
    respect the `close` callback of the iterable returned by the application.
    Because it is useful to add another close action to a returned iterable
    and adding a custom iterable is a boring task this class can be used for
    that::
 
        return ClosingIterator(app(environ, start_response), [cleanup_session,
                                                              cleanup_locals])
 
    If there is just one close function it can be passed instead of the list.
 
    A closing iterator is not needed if the application uses response objects
    and finishes the processing if the response is started::
 
        try:
            return response(environ, start_response)
        finally:
            cleanup_session()
            cleanup_locals()
    Nút.Iterable[bytes]z@None | (t.Callable[[], None] | t.Iterable[t.Callable[[], None]])ÚNone)ÚiterableÚ    callbacksrcCsrt|ƒ}t tjgtftt|ƒ¡|_|dkr4g}nt|ƒrD|g}nt    |ƒ}t
|ddƒ}|rh|  d|¡||_ dS)NÚcloser) Úiterr>r?ÚCallablerArÚnextÚ_nextÚcallableÚlistÚgetattrÚinsertÚ
_callbacks)ÚselfrWrXÚiteratorZiterable_closerrrÚ__init__
s  zClosingIterator.__init__©rcCs|S©Nr©rcrrrÚ__iter__szClosingIterator.__iter__rAcCs| ¡Srg)r]rhrrrÚ__next__ szClosingIterator.__next__cCs|jD]
}|ƒqdSrg)rb)rcÚcallbackrrrrY#s
zClosingIterator.close)N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rerirjrYrrrrrTôs ürTé r1rU)rÚfileÚ buffer_sizercCs| dt¡||ƒS)aWraps a file.  This uses the WSGI server's file wrapper if available
    or otherwise the generic :class:`FileWrapper`.
 
    .. versionadded:: 0.5
 
    If the file wrapper from the WSGI server is used it's important to not
    iterate over it from inside the application but to pass it through
    unchanged.  If you want to pass out a file wrapper inside a response
    object you have to set :attr:`Response.direct_passthrough` to `True`.
 
    More information about file wrappers are available in :pep:`333`.
 
    :param file: a :class:`file`-like object with a :meth:`~file.read` method.
    :param buffer_size: number of bytes for one iteration.
    zwsgi.file_wrapper)r,Ú FileWrapper)rrqrrrrrÚ    wrap_file(s
ÿrtc@szeZdZdZdddddœdd„Zdd    œd
d „Zd d    œd d„Zdddœdd„Zdd    œdd„Zdd    œdd„Z    dd    œdd„Z
dS)rsa\This class can be used to convert a :class:`file`-like object into
    an iterable.  It yields `buffer_size` blocks until the file is fully
    read.
 
    You should not use this class directly but rather use the
    :func:`wrap_file` function that uses the WSGI server's file wrapper
    support if it's available.
 
    .. versionadded:: 0.5
 
    If you're using this object together with a :class:`Response` you have
    to use the `direct_passthrough` mode.
 
    :param file: a :class:`file`-like object with a :meth:`~file.read` method.
    :param buffer_size: number of bytes for one iteration.
    rpr:r1rV)rqrrrcCs||_||_dSrg)rqrr)rcrqrrrrrreQszFileWrapper.__init__rfcCst|jdƒr|j ¡dS©NrY)ÚhasattrrqrYrhrrrrYUs zFileWrapper.closercCs*t|jdƒr|j ¡St|jdƒr&dSdS)NÚseekableÚseekTF)rvrqrwrhrrrrwYs
 
 zFileWrapper.seekablerH)ÚargsrcGst|jdƒr|jj|ŽdS)Nrx)rvrqrx)rcryrrrrx`s zFileWrapper.seekr7cCst|jdƒr|j ¡SdS)NÚtell)rvrqrzrhrrrrzds 
zFileWrapper.tellcCs|SrgrrhrrrriiszFileWrapper.__iter__rAcCs |j |j¡}|r|Stƒ‚dSrg)rqÚreadrrÚ StopIteration)rcÚdatarrrrjlszFileWrapper.__next__N)rp) rlrmrnrorerYrwrxrzrirjrrrrrs?srsc@sxeZdZdZdddddœdd    „Zdd
œd d „Zd d
œdd„Zdd
œdd„Zd d
œdd„Zd d
œdd„Z    dd
œdd„Z
dS)Ú _RangeWrapperasThis class can be used to convert an iterable object into
    an iterable that will only yield a piece of the underlying content.
    It yields blocks until the underlying stream range is fully read.
    The yielded blocks will have a size that can't exceed the original
    iterator defined block size, but that can be smaller.
 
    If you're using this object together with a :class:`Response` you have
    to use the `direct_passthrough` mode.
 
    :param iterable: an iterable object with a :meth:`__next__` method.
    :param start_byte: byte from which read will start.
    :param byte_range: how many bytes to read.
    rNút.Iterable[bytes] | t.IO[bytes]r1r7)rWÚ
start_byteÚ
byte_rangecCsRt|ƒ|_||_||_d|_|dk    r.|||_d|_t|dƒoD| ¡|_d|_dS)NrrwF)    rZrWrr€Úend_byteÚ read_lengthrvrwÚ end_reached)rcrWr€rrrrre„s
 
z_RangeWrapper.__init__rfcCs|Srgrrhrrrri–sz_RangeWrapper.__iter__rAcCsDz"t|jƒ}|jt|ƒ7_|WStk
r>d|_‚YnXdS©NT)r\rWrƒÚlenr|r„©rcÚchunkrrrÚ _next_chunk™s
z_RangeWrapper._next_chunkztuple[bytes | None, int]cCsld}|jr,|j |j¡|j ¡|_|j}n8|j|jkrB| ¡}q,|dk    r^||j|jd…}|j}||fSrg)rwrWrxr€rzrƒr‰©rcrˆZcontextual_read_lengthrrrÚ_first_iteration¢s  
z_RangeWrapper._first_iterationcCsn|jr tƒ‚d}|j}|jdkr,| ¡\}}|dkr<| ¡}|jdk    rj|j|jkrjd|_|d|j|…S|S)NrT)r„r|rƒr‹r‰r‚rŠrrrr]°s
 z_RangeWrapper._nextcCs | ¡}|r|Sd|_tƒ‚dSr…)r]r„r|r‡rrrrj¾s
z_RangeWrapper.__next__rVcCst|jdƒr|j ¡dSru)rvrWrYrhrrrrYÅs z_RangeWrapper.close)rN) rlrmrnrorerir‰r‹r]rjrYrrrrr~ssü    r~rút.Iterator[bytes])rEÚlimitrrrccs¦tjdtddt|tttfƒr(tdƒ‚t|dƒsJ|D]}|r6|Vq6dSt     
t    j t|¡}t|t ƒs†|dk    r†t     
t    j tt ||ƒ¡}|j }||ƒ}|sšq¢|VqŒdS)z-Helper for the line and chunk iter functions.zE'_make_chunk_iter' is deprecated and will be removed in Werkzeug 3.0.rKrLzBPassed a string or byte object instead of true iterator or stream.r{N)rOrPrQÚ
isinstancerAÚ    bytearrayrr2rvr>r?r@rBr{)rErrrÚitemÚ_readrrrÚ_make_chunk_iterÊs,ýÿ
r’é()rErrrÚ cap_at_bufferrc #sútjdtddt||ˆƒ‰tˆdƒ}|s.dSt|ƒ}t t|dƒ¡‰t t|dƒ¡}t t|dƒ¡}t t|dƒ¡‰t tj    tt
|fˆƒ¡‰d    d
œ‡‡‡‡‡fd d „ }ˆ}    |ƒD]6}
|
|krÜ|    d d…|krÜ|    |
7}    ˆ}
|    ræ|    V|
}    q´|    rö|    VdS)aÓSafely iterates line-based over an input stream.  If the input stream
    is not a :class:`LimitedStream` the `limit` parameter is mandatory.
 
    This uses the stream's :meth:`~file.read` method internally as opposite
    to the :meth:`~file.readline` method that is unsafe and can only be used
    in violation of the WSGI specification.  The same problem applies to the
    `__iter__` function of the input stream which calls :meth:`~file.readline`
    without arguments.
 
    If you need line-by-line processing it's strongly recommended to iterate
    over the input stream using this helper function.
 
    .. deprecated:: 2.3
        Will be removed in Werkzeug 3.0.
 
    .. versionadded:: 0.11
       added support for the `cap_at_buffer` parameter.
 
    .. versionadded:: 0.9
       added support for iterators as input stream.
 
    .. versionchanged:: 0.8
       This function now ensures that the limit was reached.
 
    :param stream: the stream or iterate to iterate over.
    :param limit: the limit in bytes for the stream.  (Usually
                  content length.  Not necessary if the `stream`
                  is a :class:`LimitedStream`.
    :param buffer_size: The optional buffer size.
    :param cap_at_buffer: if this is set chunks are split if they are longer
                          than the buffer size.  Internally this is implemented
                          that the buffer size might be exhausted by a factor
                          of two however.
    zC'make_line_iter' is deprecated and will be removed in Werkzeug 3.0.rKrLr%Nú Ú
z
rŒrfc3sڈj}g}tˆdƒ}|sqÈg}d}t tjtt|| d¡ƒ¡D]€}| |¡|t    |ƒ7}|r~|dd…ˆkr~||ƒVg}q@ˆr@|ˆkr@||ƒ}t    |ƒˆkrº|dˆ…V|ˆd…}q’|g}q@|}q
|rÖ||ƒVdS)Nr%rTéÿÿÿÿ)
Újoinr\r>r?ÚIteratorrArÚ
splitlinesÚappendr†)Ú_joinÚbufferÚnew_dataÚnew_bufÚbuf_sizerÚrv©Ú_iterrrr”ZcrlfÚemptyrrÚ_iter_basic_lines&s2
ÿ
 
  z)make_line_iter.<locals>._iter_basic_linesr—) rOrPrQr’r\rr>r?rAr™r) rErrrr”Ú
first_itemÚsZcrÚlfr¥Úpreviousrrr¢rÚmake_line_iterês4(ý 
 
rªrA)rEÚ    separatorrrrr”rccsttjdtddt|||ƒ}t|dƒ}|s.dSt tjtt    |f|ƒ¡}t
|t ƒr|t |ƒ}t  dt  |¡›d¡j}dj}n(t|ƒ}t  d    t  |¡d
¡j}dj}g}    t|dƒ}
|
sºq`||
ƒ} g} d } t    |    | ƒD]„}||krô|| ƒVg} d } qÔ| t|ƒ7} |  |¡|rÔ| |krÔ|| ƒ}t|ƒ|krJ|d|…V||d…}q|g} t|ƒ} qÔ| }    q¨|    rp||    ƒVdS) aNWorks like :func:`make_line_iter` but accepts a separator
    which divides chunks.  If you want newline based processing
    you should use :func:`make_line_iter` instead as it
    supports arbitrary newline markers.
 
    .. deprecated:: 2.3
        Will be removed in Werkzeug 3.0.
 
    .. versionchanged:: 0.11
       added support for the `cap_at_buffer` parameter.
 
    .. versionchanged:: 0.9
       added support for iterators as input stream.
 
    .. versionadded:: 0.8
 
    :param stream: the stream or iterate to iterate over.
    :param separator: the separator that divides chunks.
    :param limit: the limit in bytes for the stream.  (Usually
                  content length.  Not necessary if the `stream`
                  is otherwise already limited).
    :param buffer_size: The optional buffer size.
    :param cap_at_buffer: if this is set chunks are split if they are longer
                          than the buffer size.  Internally this is implemented
                          that the buffer size might be exhausted by a factor
                          of two however.
    zD'make_chunk_iter' is deprecated and will be removed in Werkzeug 3.0.rKrLrNú(ú)r%ó(ó)r)rOrPrQr’r\r>r?r™rArrŽrr
ÚreÚcompileÚescapeÚsplitr˜r    r†r›)rEr«rrrr”r£r¦Ú_splitrœrržÚchunksrŸr rr¡rrrÚmake_chunk_iterOsR"ý 
 
 
 
 
 
r¶c@s eZdZdZd"dddddœdd    „Zedd
œd d „ƒZdd
œd d„Zd#dddœdd„Zdd
œdd„Z    dddœdd„Z
dd
œdd„Z dd
œdd„Z dd
œd d!„Z dS)$rBa:Wrap a stream so that it doesn't read more than a given limit. This is used to
    limit ``wsgi.input`` to the ``Content-Length`` header value or
    :attr:`.Request.max_content_length`.
 
    When attempting to read after the limit has been reached, :meth:`on_exhausted` is
    called. When the limit is a maximum, this raises :exc:`.RequestEntityTooLarge`.
 
    If reading from the stream returns zero bytes or raises an error,
    :meth:`on_disconnect` is called, which raises :exc:`.ClientDisconnected`. When the
    limit is a maximum and zero bytes were read, no error is raised, since it may be the
    end of the stream.
 
    If the limit is reached before the underlying stream is exhausted (such as a file
    that is too large, or an infinite stream), the remaining contents of the stream
    cannot be read safely. Depending on how the server handles this, clients may show a
    "connection reset" failure instead of seeing the 413 response.
 
    :param stream: The stream to read from. Must be a readable binary IO object.
    :param limit: The limit in bytes to not read past. Should be either the
        ``Content-Length`` header value or ``request.max_content_length``.
    :param is_max: Whether the given ``limit`` is ``request.max_content_length`` instead
        of the ``Content-Length`` header value. This changes how exhausted and
        disconnect events are handled.
 
    .. versionchanged:: 2.3
        Handle ``max_content_length`` differently than ``Content-Length``.
 
    .. versionchanged:: 2.3
        Implements ``io.RawIOBase`` rather than ``io.IOBase``.
    Fr:r1rrV)rErr=rcCs||_d|_||_||_dS)Nr)Ú_streamÚ_posrÚ _limit_is_max)rcrErr=rrrreÅszLimitedStream.__init__rfcCs |j|jkS)z:Whether the current stream position has reached the limit.)r¸rrhrrrÚ is_exhaustedËszLimitedStream.is_exhaustedcCs|jr tƒ‚dS)aŠCalled when attempting to read after the limit has been reached.
 
        The default behavior is to do nothing, unless the limit is a maximum, in which
        case it raises :exc:`.RequestEntityTooLarge`.
 
        .. versionchanged:: 2.3
            Raises ``RequestEntityTooLarge`` if the limit is a maximum.
 
        .. versionchanged:: 2.3
            Any return value is ignored.
        N)r¹r rhrrrÚ on_exhaustedÐs zLimitedStream.on_exhaustedNzException | None)ÚerrorrcCs|jr|dk    rtƒ‚dS)aCalled when an attempted read receives zero bytes before the limit was
        reached. This indicates that the client disconnected before sending the full
        request body.
 
        The default behavior is to raise :exc:`.ClientDisconnected`, unless the limit is
        a maximum and no error was raised.
 
        .. versionchanged:: 2.3
            Added the ``error`` parameter. Do nothing if the limit is a maximum and no
            error was raised.
 
        .. versionchanged:: 2.3
            Any return value is ignored.
        N)r¹r )rcr¼rrrÚ on_disconnectßszLimitedStream.on_disconnectrAcCs|js| ¡SdS)a>Exhaust the stream by reading until the limit is reached or the client
        disconnects, returning the remaining data.
 
        .. versionchanged:: 2.3
            Return the remaining data.
 
        .. versionchanged:: 2.2.3
            Handle case where wrapped stream returns fewer bytes than requested.
        r)rºÚreadallrhrrrÚexhaustõs
zLimitedStream.exhaustrr7)Úbrc
Csvt|ƒ}|j|j}|dkr(| ¡dSt|jdƒrì||krˆz|j |¡}Wqêttfk
r„}z|j    |dWY¢dSd}~XYqêXnbt
|ƒ}z|j |¡}Wn8ttfk
rØ}z|j    |dWY¢dSd}~XYnX|rê||d|…<nfz|j  t ||ƒ¡}Wn:ttfk
r<}z|j    |dWY¢dSd}~XYnXt|ƒ}||d|…<|sd|     ¡dS|j|7_|S)NrÚreadinto)r¼) r†rr¸r»rvr·rÁÚOSErrorr3r½rr{Úmin)rcrÀÚsizeÚ    remainingZout_sizeÚeZtemp_br}rrrrÁs@      zLimitedStream.readintocCsB|jr| ¡dStƒ}|js:| d¡}|s.q:| |¡qt|ƒS)Nri)rºr»rr{ÚextendrA)rcÚoutr}rrrr¾4s
 zLimitedStream.readallcCs|jS)zKReturn the current stream position.
 
        .. versionadded:: 0.9
        )r¸rhrrrrzGszLimitedStream.tellcCsdSr…rrhrrrÚreadableNszLimitedStream.readable)F)N)rlrmrnroreÚpropertyrºr»r½r¿rÁr¾rzrÉrrrrrB¥s0rB)FFFN)N)TN).N)rp)Nr“F)Nr“F),Ú
__future__rrCr°Útypingr>rOÚ    functoolsrrÚ    itertoolsrÚ    _internalrr    r
Ú
exceptionsr r Zsansior r.Z sansio.utilsrÚ TYPE_CHECKINGZ_typeshed.wsgirrrr/r6r+r9rGrSrTrtrsr~r’rªr¶Ú    RawIOBaserBrrrrÚ<module>s`             û&ÿýFý)5ÿ4W"ühûV