zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
U
Z±dg|ã@sÐUddlZddlZddlZddlmZddlmZddlmZddl    Z    ddlm
Z
ddl m Z m Z mZddlmZdd    lmZdd
lmZdd lmZmZmZdd lmZdd lmZddlZeed<e
rîe e e dœdd„Z!ddlm"Z"m#Z#nˆdZ$zddlm!Z!Wnre%k
rtej&dkrlddl'Z'e'j(dddZ)e'j*e)j+_,e'j*e'j*e'j*ge)j+_-dZ.e e e dœdd„Z!ndZ$YnXGdd„de edZ/ddddœe/dœdd „Z0d!d"„Z1d#d$„Z2d%ddddej3d&œd'd(„Z4dS))éN)Ú    ExitStack)ÚOptional)Úpartial)Ú TYPE_CHECKINGé)Ú AsyncResourceÚ
SendStreamÚ ReceiveStream)ÚClosedResourceError)Ú StapledStream)ÚLock)Úwait_child_exitingÚcreate_pipe_to_child_stdinÚcreate_pipe_from_child_output)Ú
deprecated)ÚNoPublicConstructorÚcan_try_pidfd_open)ÚfdÚflagsÚreturncCsdS©N©)rrrrúGd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\trio/_subprocess.pyÚ
pidfd_opensr)ÚClosableReceiveStreamÚClosableSendStreamT)rÚlinux)Ú    use_errnoi²cCs2t t||¡}|dkr.t ¡}t|t |¡ƒ‚|S©Nr)Ú_cdll_for_pidfd_openÚsyscallÚ__NR_pidfd_openÚctypesÚ    get_errnoÚOSErrorÚosÚstrerror)rrÚresultÚerrrrrr;s
Fc@sšeZdZdZdZdZdZdZdd„Zdd„Z    e
dd    „ƒZ e d
d d d ddd„ƒZ e d
d d ddd„ƒZdd„Zdd„Zdd„Zdd„Zdd„Zdd„ZdS) ÚProcessu¦A child process. Like :class:`subprocess.Popen`, but async.
 
    This class has no public constructor. The most common way to get a
    `Process` object is to combine `Nursery.start` with `run_process`::
 
       process_object = await nursery.start(run_process, ...)
 
    This way, `run_process` supervises the process and makes sure that it is
    cleaned up properly, while optionally checking the return value, feeding
    it input, and so on.
 
    If you need more control â€“ for example, because you want to spawn a child
    process that outlives your program â€“ then another option is to use
    `trio.lowlevel.open_process`::
 
       process_object = await trio.lowlevel.open_process(...)
 
    Attributes:
      args (str or list): The ``command`` passed at construction time,
          specifying the process to execute and its arguments.
      pid (int): The process ID of the child process managed by this object.
      stdin (trio.abc.SendStream or None): A stream connected to the child's
          standard input stream: when you write bytes here, they become available
          for the child to read. Only available if the :class:`Process`
          was constructed using ``stdin=PIPE``; otherwise this will be None.
      stdout (trio.abc.ReceiveStream or None): A stream connected to
          the child's standard output stream: when the child writes to
          standard output, the written bytes become available for you
          to read here. Only available if the :class:`Process` was
          constructed using ``stdout=PIPE``; otherwise this will be None.
      stderr (trio.abc.ReceiveStream or None): A stream connected to
          the child's standard error stream: when the child writes to
          standard error, the written bytes become available for you
          to read here. Only available if the :class:`Process` was
          constructed using ``stderr=PIPE``; otherwise this will be None.
      stdio (trio.StapledStream or None): A stream that sends data to
          the child's standard input and receives from the child's standard
          output. Only available if both :attr:`stdin` and :attr:`stdout` are
          available; otherwise this will be None.
 
    FNcCsž||_||_||_||_d|_|jdk    rB|jdk    rBt|j|jƒ|_tƒ|_d|_t    r†zt
|jj dƒ}Wnt k
rzYn Xt |ƒ|_|jj|_|jj |_ dSr)Ú_procÚstdinÚstdoutÚstderrÚstdior r Ú
_wait_lockÚ_pidfdrrÚpidr$ÚopenÚargs)ÚselfÚpopenr+r,r-rrrrÚ__init__zs"
 
zProcess.__init__cCsJ|j}|dkrd |j¡}n |dkr2d | ¡}n
d |¡}d |j|¡S)Nzrunning with PID {}rzexited with signal {}zexited with status {}z<trio.Process {!r}: {}>)Ú
returncodeÚformatr1r3)r4r7ÚstatusrrrÚ__repr__˜s
zProcess.__repr__cCs|j ¡}|dk    r| ¡|S)a—The exit status of the process (an integer), or ``None`` if it's
        still running.
 
        By convention, a return code of zero indicates success.  On
        UNIX, negative values indicate termination due to a signal,
        e.g., -11 if terminated by signal 11 (``SIGSEGV``).  On
        Windows, a process that exits due to a call to
        :meth:`Process.terminate` will have an exit status of 1.
 
        Unlike the standard library `subprocess.Popen.returncode`, you don't
        have to call `poll` or `wait` to update this attribute; it's
        automatically updated as needed, and will always give you the latest
        information.
 
        N)r*ÚpollÚ _close_pidfd)r4r'rrrr7£s
zProcess.returncodez0.20.0z.using trio.Process as an async context manageriPz.run_process or nursery.start(run_process, ...))ÚthingÚissueÚinsteadcÃs|Srr©r4rrrÚ
__aenter__¹szProcess.__aenter__)r>r?cÃsºtjddT|jdk    r(|j ¡IdH|jdk    rB|j ¡IdH|jdk    r\|j ¡IdHW5QRXz|     ¡IdHW5|jjdkr´| ¡tjdd|     ¡IdHW5QRXXdS)záClose any pipes we have to the process (both input and output)
        and wait for it to exit.
 
        If cancelled, kills the process and waits for it to finish
        exiting before propagating the cancellation.
        T©ZshieldN)
ÚtrioÚ CancelScoper+Úacloser,r-r*r7ÚkillÚwaitr@rrrrEÂs
 
 
 
 zProcess.aclosecCs0|jdk    r,tj |j ¡¡|j ¡d|_dSr)r0rCÚlowlevelZnotify_closingÚfilenoÚcloser@rrrr<Ûs
 
zProcess._close_pidfdc
Ãsž|j4IdHšl| ¡dkrv|jdk    rVztj |j¡IdHWqdtk
rRYqdXnt|ƒIdH|j     ¡| 
¡W5QIdHRX|jj dk    s–t ‚|jj S)z{Block until the process exits.
 
        Returns:
          The exit status of the process; see :attr:`returncode`.
        N) r/r;r0rCrHZ wait_readabler
r r*rGr<r7ÚAssertionErrorr@rrrrGás 
 
z Process.waitcCs|jS)a‹Returns the exit status of the process (an integer), or ``None`` if
        it's still running.
 
        Note that on Trio (unlike the standard library `subprocess.Popen`),
        ``process.poll()`` and ``process.returncode`` always give the same
        result. See `returncode` for more details. This method is only
        included to make it easier to port code from `subprocess`.
 
        )r7r@rrrr;ýs
z Process.pollcCs|j |¡dS)a,Send signal ``sig`` to the process.
 
        On UNIX, ``sig`` may be any signal defined in the
        :mod:`signal` module, such as ``signal.SIGINT`` or
        ``signal.SIGTERM``. On Windows, it may be anything accepted by
        the standard library :meth:`subprocess.Popen.send_signal`.
        N)r*Ú send_signal)r4ÚsigrrrrL    szProcess.send_signalcCs|j ¡dS)afTerminate the process, politely if possible.
 
        On UNIX, this is equivalent to
        ``send_signal(signal.SIGTERM)``; by convention this requests
        graceful termination, but a misbehaving or buggy process might
        ignore it. On Windows, :meth:`terminate` forcibly terminates the
        process in the same manner as :meth:`kill`.
        N)r*Ú    terminater@rrrrNs    zProcess.terminatecCs|j ¡dS)a™Immediately terminate the process.
 
        On UNIX, this is equivalent to
        ``send_signal(signal.SIGKILL)``.  On Windows, it calls
        ``TerminateProcess``. In both cases, the process cannot
        prevent itself from being killed, but the termination will be
        delivered asynchronously; use :meth:`wait` if you want to
        ensure the process is actually dead before proceeding.
        N)r*rFr@rrrrFs
z Process.kill)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Úuniversal_newlinesÚencodingÚerrorsZ_wait_for_exit_datar6r:Úpropertyr7rrArEr<rGr;rLrNrFrrrrr)Fs8* 
ü
ÿ
 
 r))Ú    metaclass©r+r,r-)rc
ËszdD]}| |¡rtd |¡ƒ‚qtjdkrdt|tƒrH| d¡sHtdƒ‚t|tƒsd| d¡rdtdƒ‚d}d}d}tƒî}    tƒÜ}
|tj    kr®t
ƒ\}}|      tj |¡|
  |j ¡|tj    krÜt ƒ\}}|      tj |¡|
  |j ¡|tjkrô|dk    rò|}n0|tj    kr$t ƒ\}}|      tj |¡|
  |j ¡tj ttj|f|||dœ|—Ž¡IdH} |
 ¡W5QRXW5QRXt | |||¡S)    aF
Execute a child program in a new process.
 
    After construction, you can interact with the child process by writing data to its
    `~trio.Process.stdin` stream (a `~trio.abc.SendStream`), reading data from its
    `~trio.Process.stdout` and/or `~trio.Process.stderr` streams (both
    `~trio.abc.ReceiveStream`\s), sending it signals using `~trio.Process.terminate`,
    `~trio.Process.kill`, or `~trio.Process.send_signal`, and waiting for it to exit
    using `~trio.Process.wait`. See `trio.Process` for details.
 
    Each standard stream is only available if you specify that a pipe should be created
    for it. For example, if you pass ``stdin=subprocess.PIPE``, you can write to the
    `~trio.Process.stdin` stream, else `~trio.Process.stdin` will be ``None``.
 
    Unlike `trio.run_process`, this function doesn't do any kind of automatic
    management of the child process. It's up to you to implement whatever semantics you
    want.
 
    Args:
      command (list or str): The command to run. Typically this is a
          sequence of strings such as ``['ls', '-l', 'directory with spaces']``,
          where the first element names the executable to invoke and the other
          elements specify its arguments. With ``shell=True`` in the
          ``**options``, or on Windows, ``command`` may alternatively
          be a string, which will be parsed following platform-dependent
          :ref:`quoting rules <subprocess-quoting>`.
      stdin: Specifies what the child process's standard input
          stream should connect to: output written by the parent
          (``subprocess.PIPE``), nothing (``subprocess.DEVNULL``),
          or an open file (pass a file descriptor or something whose
          ``fileno`` method returns one). If ``stdin`` is unspecified,
          the child process will have the same standard input stream
          as its parent.
      stdout: Like ``stdin``, but for the child process's standard output
          stream.
      stderr: Like ``stdin``, but for the child process's standard error
          stream. An additional value ``subprocess.STDOUT`` is supported,
          which causes the child's standard output and standard error
          messages to be intermixed on a single standard output stream,
          attached to whatever the ``stdout`` option says to attach it to.
      **options: Other :ref:`general subprocess options <subprocess-options>`
          are also accepted.
 
    Returns:
      A new `trio.Process` object.
 
    Raises:
      OSError: if the process spawning fails, for example because the
         specified command could not be found.
 
    )rSÚtextrTrUÚbufsizezgtrio.Process only supports communicating over unbuffered byte streams; the '{}' option is not supportedÚposixÚshellzHcommand must be a sequence (not a string) if shell=False on UNIX systemszGcommand must be a string (not a sequence) if shell=True on UNIX systemsNrX)ÚgetÚ    TypeErrorr8r%ÚnameÚ
isinstanceÚstrrÚ
subprocessÚPIPErÚcallbackrJrÚSTDOUTrCZ    to_threadZrun_syncrÚPopenÚpop_allr)Ú_create) Úcommandr+r,r-ÚoptionsÚkeyZ
trio_stdinZ trio_stdoutZ trio_stderrZalways_cleanupZcleanup_on_failr5rrrÚ open_process+sb5
ÿÿ
ÿÿ
 
 
 
 
 
 þûúÿ
rlc
ÃsNz | ¡Wn<tk
rH}zt td|›d|›ƒ¡W5d}~XYnXdS)NzTerminateProcess on z failed with: )rNr$ÚwarningsÚwarnÚRuntimeWarning©ÚpÚexcrrrÚ_windows_deliver_cancel£s rsc
Ãs|z:| ¡t d¡IdHt td|›dƒ¡| ¡Wn<tk
rv}zt td|›d|›ƒ¡W5d}~XYnXdS)Nézprocess z` ignored SIGTERM for 5 seconds. (Maybe you should pass a custom deliver_cancel?) Trying SIGKILL.ztried to kill process z, but failed with: )rNrCÚsleeprmrnrorFr$rprrrÚ_posix_deliver_cancelªs
ÿÿ ÿrvó)r+Úcapture_stdoutÚcapture_stderrÚcheckÚdeliver_cancelÚ task_statusc ‹s”t|tƒrtdƒ‚|tjkr^|tjkr.tdƒ‚| d¡tjkrFtdƒ‚| d¡tjkr^tdƒ‚t|t    t
t fƒr~|‰tj|d<n d‰||d<|r¨d|kržtd    ƒ‚tj|d<|rÆd|kr¼td
ƒ‚tj|d<ˆdkrðt j d krÞt‰nt j d ksìt‚t‰g}g}    ‡fd d„}
dd„} t ¡4IdHš} t|f|ŽIdH‰z~ˆdk    rX|  |
ˆj¡dˆ_dˆ_|rz|  | ˆj|¡dˆ_dˆ_|r–|  | ˆj|    ¡dˆ_| ˆ¡ˆ ¡IdHWnltk
rtjddDtjdd‰‡‡‡fdd„} |  | ¡ˆ ¡IdHˆ ¡‚W5QRXYnXW5QIdHRX|r>d |¡nd}|rRd |    ¡nd}ˆjr||r|tjˆjˆj ||d‚nt !ˆj ˆj||¡SdS)uÿ%Run ``command`` in a subprocess and wait for it to complete.
 
    This function can be called in two different ways.
 
    One option is a direct call, like::
 
        completed_process_info = await trio.run_process(...)
 
    In this case, it returns a :class:`subprocess.CompletedProcess` instance
    describing the results. Use this if you want to treat a process like a
    function call.
 
    The other option is to run it as a task using `Nursery.start` â€“ the enhanced version
    of `~Nursery.start_soon` that lets a task pass back a value during startup::
 
        process = await nursery.start(trio.run_process, ...)
 
    In this case, `~Nursery.start` returns a `Process` object that you can use
    to interact with the process while it's running. Use this if you want to
    treat a process like a background task.
 
    Either way, `run_process` makes sure that the process has exited before
    returning, handles cancellation, optionally checks for errors, and
    provides some convenient shorthands for dealing with the child's
    input/output.
 
    **Input:** `run_process` supports all the same ``stdin=`` arguments as
    `subprocess.Popen`. In addition, if you simply want to pass in some fixed
    data, you can pass a plain `bytes` object, and `run_process` will take
    care of setting up a pipe, feeding in the data you gave, and then sending
    end-of-file. The default is ``b""``, which means that the child will receive
    an empty stdin. If you want the child to instead read from the parent's
    stdin, use ``stdin=None``.
 
    **Output:** By default, any output produced by the subprocess is
    passed through to the standard output and error streams of the
    parent Trio process.
 
    When calling `run_process` directly, you can capture the subprocess's output by
    passing ``capture_stdout=True`` to capture the subprocess's standard output, and/or
    ``capture_stderr=True`` to capture its standard error. Captured data is collected up
    by Trio into an in-memory buffer, and then provided as the
    :attr:`~subprocess.CompletedProcess.stdout` and/or
    :attr:`~subprocess.CompletedProcess.stderr` attributes of the returned
    :class:`~subprocess.CompletedProcess` object. The value for any stream that was not
    captured will be ``None``.
 
    If you want to capture both stdout and stderr while keeping them
    separate, pass ``capture_stdout=True, capture_stderr=True``.
 
    If you want to capture both stdout and stderr but mixed together
    in the order they were printed, use: ``capture_stdout=True, stderr=subprocess.STDOUT``.
    This directs the child's stderr into its stdout, so the combined
    output will be available in the `~subprocess.CompletedProcess.stdout`
    attribute.
 
    If you're using ``await nursery.start(trio.run_process, ...)`` and want to capture
    the subprocess's output for further processing, then use ``stdout=subprocess.PIPE``
    and then make sure to read the data out of the `Process.stdout` stream. If you want
    to capture stderr separately, use ``stderr=subprocess.PIPE``. If you want to capture
    both, but mixed together in the correct order, use ``stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT``.
 
    **Error checking:** If the subprocess exits with a nonzero status
    code, indicating failure, :func:`run_process` raises a
    :exc:`subprocess.CalledProcessError` exception rather than
    returning normally. The captured outputs are still available as
    the :attr:`~subprocess.CalledProcessError.stdout` and
    :attr:`~subprocess.CalledProcessError.stderr` attributes of that
    exception.  To disable this behavior, so that :func:`run_process`
    returns normally even if the subprocess exits abnormally, pass ``check=False``.
 
    Note that this can make the ``capture_stdout`` and ``capture_stderr``
    arguments useful even when starting `run_process` as a task: if you only
    care about the output if the process fails, then you can enable capturing
    and then read the output off of the `~subprocess.CalledProcessError`.
 
    **Cancellation:** If cancelled, `run_process` sends a termination
    request to the subprocess, then waits for it to fully exit. The
    ``deliver_cancel`` argument lets you control how the process is terminated.
 
    .. note:: `run_process` is intentionally similar to the standard library
       `subprocess.run`, but some of the defaults are different. Specifically, we
       default to:
 
       - ``check=True``, because `"errors should never pass silently / unless
         explicitly silenced" <https://www.python.org/dev/peps/pep-0020/>`__.
 
       - ``stdin=b""``, because it produces less-confusing results if a subprocess
         unexpectedly tries to read from stdin.
 
       To get the `subprocess.run` semantics, use ``check=False, stdin=None``.
 
    Args:
      command (list or str): The command to run. Typically this is a
          sequence of strings such as ``['ls', '-l', 'directory with spaces']``,
          where the first element names the executable to invoke and the other
          elements specify its arguments. With ``shell=True`` in the
          ``**options``, or on Windows, ``command`` may alternatively
          be a string, which will be parsed following platform-dependent
          :ref:`quoting rules <subprocess-quoting>`.
 
      stdin (:obj:`bytes`, subprocess.PIPE, file descriptor, or None): The
          bytes to provide to the subprocess on its standard input stream, or
          ``None`` if the subprocess's standard input should come from the
          same place as the parent Trio process's standard input. As is the
          case with the :mod:`subprocess` module, you can also pass a file
          descriptor or an object with a ``fileno()`` method, in which case
          the subprocess's standard input will come from that file.
 
          When starting `run_process` as a background task, you can also use
          ``stdin=subprocess.PIPE``, in which case `Process.stdin` will be a
          `~trio.abc.SendStream` that you can use to send data to the child.
 
      capture_stdout (bool): If true, capture the bytes that the subprocess
          writes to its standard output stream and return them in the
          `~subprocess.CompletedProcess.stdout` attribute of the returned
          `subprocess.CompletedProcess` or `subprocess.CalledProcessError`.
 
      capture_stderr (bool): If true, capture the bytes that the subprocess
          writes to its standard error stream and return them in the
          `~subprocess.CompletedProcess.stderr` attribute of the returned
          `~subprocess.CompletedProcess` or `subprocess.CalledProcessError`.
 
      check (bool): If false, don't validate that the subprocess exits
          successfully. You should be sure to check the
          ``returncode`` attribute of the returned object if you pass
          ``check=False``, so that errors don't pass silently.
 
      deliver_cancel (async function or None): If `run_process` is cancelled,
          then it needs to kill the child process. There are multiple ways to
          do this, so we let you customize it.
 
          If you pass None (the default), then the behavior depends on the
          platform:
 
          - On Windows, Trio calls ``TerminateProcess``, which should kill the
            process immediately.
 
          - On Unix-likes, the default behavior is to send a ``SIGTERM``, wait
            5 seconds, and send a ``SIGKILL``.
 
          Alternatively, you can customize this behavior by passing in an
          arbitrary async function, which will be called with the `Process`
          object as an argument. For example, the default Unix behavior could
          be implemented like this::
 
             async def my_deliver_cancel(process):
                 process.send_signal(signal.SIGTERM)
                 await trio.sleep(5)
                 process.send_signal(signal.SIGKILL)
 
          When the process actually exits, the ``deliver_cancel`` function
          will automatically be cancelled â€“ so if the process exits after
          ``SIGTERM``, then we'll never reach the ``SIGKILL``.
 
          In any case, `run_process` will always wait for the child process to
          exit before raising `Cancelled`.
 
      **options: :func:`run_process` also accepts any :ref:`general subprocess
          options <subprocess-options>` and passes them on to the
          :class:`~trio.Process` constructor. This includes the
          ``stdout`` and ``stderr`` options, which provide additional
          redirection possibilities such as ``stderr=subprocess.STDOUT``,
          ``stdout=subprocess.DEVNULL``, or file descriptors.
 
    Returns:
 
      When called normally â€“ a `subprocess.CompletedProcess` instance
      describing the return code and outputs.
 
      When called via `Nursery.start` â€“ a `trio.Process` instance.
 
    Raises:
      UnicodeError: if ``stdin`` is specified as a Unicode string, rather
          than bytes
      ValueError: if multiple redirections are specified for the same
          stream, e.g., both ``capture_stdout=True`` and
          ``stdout=subprocess.DEVNULL``
      subprocess.CalledProcessError: if ``check=False`` is not passed
          and the process exits with a nonzero exit status
      OSError: if an error is encountered starting or communicating with
          the process
 
    .. note:: The child process runs in the same process group as the parent
       Trio process, so a Ctrl+C will be delivered simultaneously to both
       parent and child. If you don't want this behavior, consult your
       platform's documentation for starting child processes in a different
       process group.
 
    z$process stdin must be bytes, not strz¤stdout=subprocess.PIPE is only valid with nursery.start, since that's the only way to access the pipe; use nursery.start or pass the data you want to write directlyr,zestdout=subprocess.PIPE is only valid with nursery.start, since that's the only way to access the piper-zestderr=subprocess.PIPE is only valid with nursery.start, since that's the only way to access the piper+Nz,can't specify both stdout and capture_stdoutz,can't specify both stderr and capture_stderrÚntr[c
“sN|4IdHš2z| ˆ¡IdHWntjk
r8YnXW5QIdHRXdSr)Zsend_allrCZBrokenResourceError)Ústream)ÚinputrrÚ
feed_input·s
zrun_process.<locals>.feed_inputc
Ós@|4IdHš$|2z3dHW}| |¡q6W5QIdHRXdSr)Úappend)r~ÚchunksÚchunkrrrÚ read_output¾sz run_process.<locals>.read_outputTrBc    “s"ˆˆˆƒIdHW5QRXdSrrr)r{Ú killer_cscopeÚprocrrÚkiller×szrun_process.<locals>.killerrw)Úoutputr-)"r`raÚ UnicodeErrorrCÚTASK_STATUS_IGNOREDrbrcÚ
ValueErrorr]ÚbytesÚ    bytearrayÚ
memoryviewr%r_rsrKrvZ open_nurseryrlZ
start_soonr+r.r,r-ÚstartedrGÚ BaseExceptionrDÚcancelÚjoinr7ÚCalledProcessErrorr3ÚCompletedProcess)rir+rxryrzr{r|rjZ stdout_chunksZ stderr_chunksr€r„Znurseryr‡r,r-r)r{rr…r†rÚ run_process¼sL
 
 
ÿÿÿ 
 
 
 
 
 
"ÿr•)5r%rbÚsysÚ
contextlibrÚtypingrÚ    functoolsrrmrÚ_abcrrr    Z_corer
Z_highlevel_genericr Z_syncr Z_subprocess_platformr rrZ
_deprecaterZ_utilrrCÚboolÚ__annotations__ÚintrrrrÚ ImportErrorÚplatformr"ÚCDLLrÚc_longr ÚrestypeÚargtypesr!r)rlrsrvrŠr•rrrrÚ<module>sh          
    ý
gÿþ xø