Mercurial > hg
annotate rust/hg-core/Cargo.toml @ 45095:8e04607023e5
procutil: ensure that procutil.std{out,err}.write() writes all bytes
Python 3 offers different kind of streams and it’s not guaranteed for all of
them that calling write() writes all bytes.
When Python is started in unbuffered mode, sys.std{out,err}.buffer are
instances of io.FileIO, whose write() can write less bytes for
platform-specific reasons (e.g. Linux has a 0x7ffff000 bytes maximum and could
write less if interrupted by a signal; when writing to Windows consoles, it’s
limited to 32767 bytes to avoid the "not enough space" error). This can lead to
silent loss of data, both when using sys.std{out,err}.buffer (which may in fact
not be a buffered stream) and when using the text streams sys.std{out,err}
(I’ve created a CPython bug report for that:
https://bugs.python.org/issue41221).
Python may fix the problem at some point. For now, we implement our own wrapper
for procutil.std{out,err} that calls the raw stream’s write() method until all
bytes have been written. We don’t use sys.std{out,err} for larger writes, so I
think it’s not worth the effort to patch them.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Fri, 10 Jul 2020 12:27:58 +0200 |
parents | 2093b2fc70d4 |
children | 26c53ee51c68 |
rev | line source |
---|---|
40271
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
1 [package] |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
2 name = "hg-core" |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
3 version = "0.1.0" |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
4 authors = ["Georges Racinet <gracinet@anybox.fr>"] |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
5 description = "Mercurial pure Rust core library, with no assumption on Python bindings (FFI)" |
42609
326fdce22fb2
rust: switch hg-core and hg-cpython to rust 2018 edition
Raphaël Gomès <rgomes@octobus.net>
parents:
42331
diff
changeset
|
6 edition = "2018" |
40271
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
7 |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
8 [lib] |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
9 name = "hg" |
41692
ee7b7bd432a1
rust: translated random test of missingancestors
Georges Racinet <gracinet@anybox.fr>
parents:
40271
diff
changeset
|
10 |
42302
d1786c1d34fa
rust-dirstate: add rust implementation of `parse_dirstate` and `pack_dirstate`
Raphaël Gomès <rgomes@octobus.net>
parents:
41692
diff
changeset
|
11 [dependencies] |
44599
d31d1c0685be
rust: update all dependencies
Raphaël Gomès <rgomes@octobus.net>
parents:
44598
diff
changeset
|
12 byteorder = "1.3.4" |
d31d1c0685be
rust: update all dependencies
Raphaël Gomès <rgomes@octobus.net>
parents:
44598
diff
changeset
|
13 hex = "0.4.2" |
d31d1c0685be
rust: update all dependencies
Raphaël Gomès <rgomes@octobus.net>
parents:
44598
diff
changeset
|
14 lazy_static = "1.4.0" |
d31d1c0685be
rust: update all dependencies
Raphaël Gomès <rgomes@octobus.net>
parents:
44598
diff
changeset
|
15 memchr = "2.3.3" |
d31d1c0685be
rust: update all dependencies
Raphaël Gomès <rgomes@octobus.net>
parents:
44598
diff
changeset
|
16 rand = "0.7.3" |
d31d1c0685be
rust: update all dependencies
Raphaël Gomès <rgomes@octobus.net>
parents:
44598
diff
changeset
|
17 rand_pcg = "0.2.1" |
d31d1c0685be
rust: update all dependencies
Raphaël Gomès <rgomes@octobus.net>
parents:
44598
diff
changeset
|
18 rand_distr = "0.2.2" |
44158
161958ebf73c
rust-dependencies: update rayon
Raphaël Gomès <rgomes@octobus.net>
parents:
44143
diff
changeset
|
19 rayon = "1.3.0" |
44869
4313a0d7540d
rust-dependencies: update `regex` to 1.3.9
Raphaël Gomès <rgomes@octobus.net>
parents:
44599
diff
changeset
|
20 regex = "1.3.9" |
43826
5ac243a92e37
rust-performance: introduce FastHashMap type alias for HashMap
Raphaël Gomès <rgomes@octobus.net>
parents:
43271
diff
changeset
|
21 twox-hash = "1.5.0" |
44301
4caac36c66bc
rust-utils: add util for canonical path
Raphaël Gomès <rgomes@octobus.net>
parents:
44266
diff
changeset
|
22 same-file = "1.0.6" |
44539
fe7d2cf0b429
rust-status: traverse working directory in parallel
Raphaël Gomès <rgomes@octobus.net>
parents:
44386
diff
changeset
|
23 crossbeam = "0.7.3" |
44935
2093b2fc70d4
rust-dependencies: upgrade `micro-timer` dependency
Raphaël Gomès <rgomes@octobus.net>
parents:
44870
diff
changeset
|
24 micro-timer = "0.3.0" |
44540
82f51ab7a2dd
rust: add logging utils
Raphaël Gomès <rgomes@octobus.net>
parents:
44539
diff
changeset
|
25 log = "0.4.8" |
44265
c18dd48cea4a
rust-pathauditor: add Rust implementation of the `pathauditor`
Raphaël Gomès <rgomes@octobus.net>
parents:
44158
diff
changeset
|
26 |
c18dd48cea4a
rust-pathauditor: add Rust implementation of the `pathauditor`
Raphaël Gomès <rgomes@octobus.net>
parents:
44158
diff
changeset
|
27 [dev-dependencies] |
44386
8f7c6656ac79
rust-nodemap: pure Rust example
Georges Racinet <georges.racinet@octobus.net>
parents:
44305
diff
changeset
|
28 clap = "*" |
8f7c6656ac79
rust-nodemap: pure Rust example
Georges Racinet <georges.racinet@octobus.net>
parents:
44305
diff
changeset
|
29 memmap = "0.7.0" |
8f7c6656ac79
rust-nodemap: pure Rust example
Georges Racinet <georges.racinet@octobus.net>
parents:
44305
diff
changeset
|
30 pretty_assertions = "0.6.1" |
44266
9ab4830e9e3d
rust-hg-path: add useful methods to `HgPath`
Raphaël Gomès <rgomes@octobus.net>
parents:
44265
diff
changeset
|
31 tempfile = "3.1.0" |