mercurial/pure/osutil.py
changeset 30925 82f1ef8b4477
parent 30642 e995f00a9e9a
child 31644 f80d9ddc40f3
equal deleted inserted replaced
30924:48dea083f66d 30925:82f1ef8b4477
   336             fd = msvcrt.open_osfhandle(fh, flags)
   336             fd = msvcrt.open_osfhandle(fh, flags)
   337             if fd == -1:
   337             if fd == -1:
   338                 _kernel32.CloseHandle(fh)
   338                 _kernel32.CloseHandle(fh)
   339                 _raiseioerror(name)
   339                 _raiseioerror(name)
   340 
   340 
   341             f = os.fdopen(fd, mode, bufsize)
   341             f = os.fdopen(fd, pycompat.sysstr(mode), bufsize)
   342             # unfortunately, f.name is '<fdopen>' at this point -- so we store
   342             # unfortunately, f.name is '<fdopen>' at this point -- so we store
   343             # the name on this wrapper. We cannot just assign to f.name,
   343             # the name on this wrapper. We cannot just assign to f.name,
   344             # because that attribute is read-only.
   344             # because that attribute is read-only.
   345             object.__setattr__(self, 'name', name)
   345             object.__setattr__(self, 'name', name)
   346             object.__setattr__(self, '_file', f)
   346             object.__setattr__(self, '_file', f)