[PATCH 7 of 7] py3: use encoding.environ in ui.py

Pulkit Goyal 7895pulkit at gmail.com
Wed Nov 30 13:16:37 EST 2016


Can you elaborate on how we can use ui.environ because I will like to
change all os.environ things because they are source of errors on
Python 3.

On Sat, Nov 5, 2016 at 7:05 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> On Sat, 5 Nov 2016 06:02:52 +0530, Pulkit Goyal wrote:
>> On Thu, Nov 3, 2016 at 3:45 AM, Pulkit Goyal <7895pulkit at gmail.com> wrote:
>> > # HG changeset patch
>> > # User Pulkit Goyal <7895pulkit at gmail.com>
>> > # Date 1478122977 -19800
>> > #      Thu Nov 03 03:12:57 2016 +0530
>> > # Node ID 9bdf6ee77b17dc2a1ce29fb347e90bd8dd17eaed
>> > # Parent  8cd0e855ebb448a4ec1e835b346a920a1cb835cb
>> > py3: use encoding.environ in ui.py
>> >
>> > Using source transformer we add b'' everywhere. So there are no chances
>> > that those bytes string will work with os.environ on Py3 as that returns a
>> > dict of unicodes. We are relying on the errors, even though no error is raised
>> > even in future, these pieces of codes will tend to do wrong things.
>> > if statements can result in wrong boolean and certain errors can be raised
>> > while using this piece of code. Let's not wait for them to happen, fix what is
>> > wrong. If this patch goes in, I will try to do it for all the cases.
>> Yuya any comments on this. I remember asking this from you in the
>> sprint and your answer was no. But I think we have to change all
>> occurences.
>
> I've queued this as s/os.environ/encoding.environ/ seems the way to go. (We
> could use ui.environ consistently, but that's another issue.)
>
> Did I say something different?


More information about the Mercurial-devel mailing list