sapling/edenscm/hgext/convert
Jun Wu 6ad31bbf6a codemod: replace os.fdopen with util.fdopen
Summary:
`util.fdopen` now adds workarounds for read+write+seek files on Windows.
This should solve issues we have seen on Windows behaviors.

See https://www.mercurial-scm.org/repo/hg/rev/3686fa2b8eee for the Windows weirdness.

Here is a minimal program to reproduce the weirdness:

```
import os

f = open("a.txt", "wb+")

# Write 12 bytes
f.write(b"b" * 12)

# Read byte slice 2..5
f.seek(2, os.SEEK_SET)
data = f.read(3)

# Try SEEK_END
f.seek(0, os.SEEK_END)
print("%d (expect 12)" % f.tell())  # got 5 using some python.exe
```

Reviewed By: xavierd

Differential Revision: D16033678

fbshipit-source-id: 4f17c463d9bfcc0cdd38d1b15f2a9e38e5b4c132
2019-06-27 13:10:20 -07:00
..
__init__.py subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
bzr.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
common.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
convcmd.py convert: drop cvs support 2019-02-22 21:02:41 -08:00
darcs.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
filemap.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
git.py subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
gnuarch.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
hg.py subrepo: remove subrepo support 2019-03-11 10:43:55 -07:00
p4.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00
subversion.py codemod: replace os.fdopen with util.fdopen 2019-06-27 13:10:20 -07:00
transport.py codemod: import from the edenscm package 2019-01-29 17:25:32 -08:00