From: Junio C Hamano <gitster@pobox.com>
To: "Ben Keene via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Ben Keene <seraphire@gmail.com>,
Ben Keene <bkeene@partswatch.com>
Subject: Re: [PATCH v2 1/3] Cast byte strings to unicode strings in python3
Date: Sat, 16 Nov 2019 12:52:20 +0900 [thread overview]
Message-ID: <xmqqimnk4gwb.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <xmqqeey85yt6.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Sat, 16 Nov 2019 11:40:05 +0900")
Junio C Hamano <gitster@pobox.com> writes:
>> cmd += [ key ]
>> s = read_pipe(cmd, ignore_error=True)
>> _gitConfig[key] = s.strip()
>> - return _gitConfig[key]
>> + return ustring(_gitConfig[key])
>
> Likewise. I'd expect, if we were to declare that our internal
> strings are all unicode in Python 3, we'd be using a thin wrapper of
> read_pipe() that yields a unicode string, so 's' would not be a
> bytestring, and s.strip() would not be either.
Oops, I did not even realize read_pipe() is already our own. So
there is no need to any wrapper around it, if we were to declare
that all strings we use are unicode under Python 3---we just need
to have the ustring() call (after giviing the helper a better name)
directly inside read_pipe() function.
next prev parent reply other threads:[~2019-11-16 3:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-13 21:14 [PATCH 0/2] Feature: New Variable git-p4.binary Ben Keene via GitGitGadget
2019-11-13 21:14 ` [PATCH 1/2] Cast byte strings to unicode strings in python3 Ben Keene via GitGitGadget
2019-11-13 21:14 ` [PATCH 2/2] Added general variable git-p4.binary and added a default for windows of 'P4.EXE' Ben Keene via GitGitGadget
2019-11-14 2:36 ` [PATCH 0/2] Feature: New Variable git-p4.binary Junio C Hamano
2019-11-14 9:53 ` Luke Diamand
2019-11-14 20:16 ` Ben Keene
2019-11-15 9:28 ` Luke Diamand
2019-11-15 14:42 ` [PATCH v2 0/3] Feature: New Variable git-p4.p4program Ben Keene via GitGitGadget
2019-11-15 14:42 ` [PATCH v2 1/3] Cast byte strings to unicode strings in python3 Ben Keene via GitGitGadget
2019-11-16 2:40 ` Junio C Hamano
2019-11-16 3:52 ` Junio C Hamano [this message]
2019-11-15 14:42 ` [PATCH v2 2/3] Added general variable git-p4.binary and added a default for windows of 'P4.EXE' Ben Keene via GitGitGadget
2019-11-16 2:50 ` Junio C Hamano
2019-11-15 14:42 ` [PATCH v2 3/3] Changed the name of the parameter from git-p4.binary to git-p4.p4program Ben Keene via GitGitGadget
2019-11-16 2:40 ` [PATCH v2 0/3] Feature: New Variable git-p4.p4program Junio C Hamano
2019-11-18 1:15 ` Junio C Hamano
2019-12-03 15:59 ` Ben Keene
-- strict thread matches above, loose matches on Subject: below --
2019-11-13 21:07 [PATCH 0/1] git-p4.py: Cast byte strings to unicode strings in python3 Ben Keene via GitGitGadget
2019-11-15 14:39 ` [PATCH v2 0/3] " Ben Keene via GitGitGadget
2019-11-15 14:39 ` [PATCH v2 1/3] " Ben Keene via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqimnk4gwb.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=bkeene@partswatch.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=seraphire@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).