From: Junio C Hamano Date: Tue, 17 Dec 2019 22:51:58 GMT Subject: Re: [PATCH v2 04/14] git-p4: encode/decode communication with p4 for python3 Message-ID: In-Reply-To: <20191213235247.23660-6-yang.zhao@skyboxlabs.com> Yang Zhao writes: > The marshalled dict in the response given on STDOUT by p4 uses `str` for > keys and string values. When run using python3, these values are > deserialized as `bytes`, leading to a whole host of problems as the rest > of the code assumes `str` is used throughout. > > This patch changes the deserialization behaviour such that, as much as > possible, text output from p4 is decoded to native unicode strings. > Exceptions are made for the field `data` as it is usually arbitrary > binary data. `depotFile[0-9]*`, `path`, and `clientFile` are also exempt > as they contain path strings not encoded with UTF-8, and must survive > survive round-trip back to p4. Doubled "survive"; will drop one of them while queuing.