<div dir="ltr"><div dir="ltr" style="font-size:12.8px">The replace() function for py3 wasn't working when `value` was being typecasted as str. When I used <span style="font-size:12.8px">pycompat.bytestr the error was resolved. So I guess it is preserved by such methods.</span></div><div><span style="font-size:12.8px"><br></span></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=acmlzaGFiaG1hZGFuOTZAZ21haWwuY29t&type=zerocontent&guid=75ab321d-b1d1-41c9-83ff-a565f8e3d7f4"><font color="#ffffff" size="1">ᐧ</font></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 17, 2017 at 10:45 PM, Martin von Zweigbergk <span dir="ltr"><<a href="mailto:martinvonz@google.com" target="_blank">martinvonz@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Mar 17, 2017 at 6:49 AM, Rishabh Madan <span dir="ltr"><<a href="mailto:rishabhmadan96@gmail.com" target="_blank">rishabhmadan96@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sorry. I didn't know that changing the changeset message for V2 forwards it as a different stream.</div><div hspace="streak-pt-mark" style="max-height:1px"><img style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=acmlzaGFiaG1hZGFuOTZAZ21haWwuY29t&type=zerocontent&guid=4614700f-33a3-4519-a9f0-408c834356d1"><font color="#ffffff" size="1">ᐧ</font></div><div class="gmail_extra"><span><br><div class="gmail_quote">On Fri, Mar 17, 2017 at 7:14 PM, Rishabh Madan <span dir="ltr"><<a href="mailto:rishabhmadan96@gmail.com" target="_blank">rishabhmadan96@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># HG changeset patch<br>
# User Rishabh Madan <<a href="mailto:rishabhmadan96@gmail.com" target="_blank">rishabhmadan96@gmail.com</a>><br>
# Date 1489758142 -19800<br>
#      Fri Mar 17 19:12:22 2017 +0530<br>
# Node ID 3d6d9294e2247316541942c4bec518<wbr>6cb5772cd6<br>
# Parent  a5bad127128d8f60060be53d161acf<wbr>a7a32a17d5<br>
py3: change explicit conversion from str to pycompat.bytestr<br>
<br>
diff -r a5bad127128d -r 3d6d9294e224 mercurial/commands.py<br>
--- a/mercurial/commands.py     Wed Mar 15 15:48:57 2017 -0700<br>
+++ b/mercurial/commands.py     Fri Mar 17 19:12:22 2017 +0530<br>
@@ -1813,7 +1813,7 @@<br>
     matched = False<br>
     for section, name, value in ui.walkconfig(untrusted=untrus<wbr>ted):<br>
         source = ui.configsource(section, name, untrusted)<br>
-        value = str(value)<br>
+        value = pycompat.bytestr(value)<br>
         if fm.isplain():<br>
             source = source or 'none'<br>
             value = value.replace('\n', '\\n')<br></blockquote></div></span></div></blockquote><div><br></div></span><div>I thought I read that pycompat.bytestr-ness is not preserved by operations (such as replace() on this line). If that's correct, will the above still work if fm.isplain()?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><div class="gmail_extra"><span><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div><br><br clear="all"><div><br></div></span><span class="m_-6711409274016294675HOEnZb"><font color="#888888">-- <br><div class="m_-6711409274016294675m_5963869146541616949gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Rishabh Madan<div>Second Year Undergraduate student</div><div>Indian Institute of Technology, Kharagpur</div></div></div>
</font></span></div>
<br></span>______________________________<wbr>_________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org" target="_blank">Mercurial-devel@mercurial-scm.<wbr>org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/<wbr>mailman/listinfo/mercurial-dev<wbr>el</a><br>
<br></blockquote></div><br></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Rishabh Madan<div>Second Year Undergraduate student</div><div>Indian Institute of Technology, Kharagpur</div></div></div>
</div>