fixutf8 extension replaces util.posixfile with Python's file?
Adrian Buehlmann
adrian at cadifra.com
Mon Aug 1 04:18:20 CDT 2011
(to: Stefan Rusek, cc-ing mercurial-devel)
I'm just baffled to see that the fixutf8 extension seems to replace
mercurial's util.posixfile with:
class posixfile_utf8(file):
def __init__(self, name, mode='rb'):
super(posixfile_utf8, self).__init__(tounicode(name), mode)
util.posixfile = posixfile_utf8
https://bitbucket.org/stefanrusek/hg-fixutf8/src/baf283ab9f92/fixutf8.py#cl-164
which extends Python's file ! (Do I understand this correctly ???)
Near as I can tell, the fixutf8 extension is intended to be used on
Windows and on Windows we specifically can't use Python's open (see
[1]), so we created util.posixfile (implemented in osutil.posixfile for
Windows, with a pure Python version in pure/osutil.py).
[1] http://mercurial.selenic.com/wiki/UnlinkingFilesOnWindows
More information about the Mercurial-devel
mailing list