Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 40258:2f47703c5489
context: open files in bytes mode
I'm stunned this open() call has survived this long without the b in
the mode - it seems like it should have been a source of bugs somewhere...
Differential Revision: https://phab.mercurial-scm.org/D5080
author | Augie Fackler <augie@google.com> |
---|---|
date | Sat, 13 Oct 2018 08:54:31 -0400 |
parents | aa41f1b01f31 |
children | af2306bf7d5d |
comparison
equal
deleted
inserted
replaced
40257:c3970be8deca | 40258:2f47703c5489 |
---|---|
2431 def remove(self): | 2431 def remove(self): |
2432 util.unlink(self._path) | 2432 util.unlink(self._path) |
2433 | 2433 |
2434 def write(self, data, flags, **kwargs): | 2434 def write(self, data, flags, **kwargs): |
2435 assert not flags | 2435 assert not flags |
2436 with open(self._path, "w") as f: | 2436 with open(self._path, "wb") as f: |
2437 f.write(data) | 2437 f.write(data) |