# HG changeset patch # User Pierre-Yves David # Date 2020-10-14 19:47:14 # Node ID d1072cba8aff6a5d7399d156fe76da87fff56d2c # Parent 99b8b73eb622c2be99847b40993f17a6ee3ff7c3 pycompat: update comment about unnamedtempfile I found the comment clearer. I end up having to think about this for `TemporaryFile` and I update that one in the process. Differential Revision: https://phab.mercurial-scm.org/D9210 diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -506,7 +506,8 @@ def mkstemp(suffix=b'', prefix=b'tmp', d return tempfile.mkstemp(suffix, prefix, dir) -# mode must include 'b'ytes as encoding= is not supported +# NamedTemporaryFile does not support an "encoding=" argument on python2. +# This wrapper file are always open in byte mode. def namedtempfile( mode=b'w+b', bufsize=-1, suffix=b'', prefix=b'tmp', dir=None, delete=True ):