Page MenuHomePhabricator

subrepo: use pycompat.open directly instead of importing open from pycompat
ClosedPublic

Authored by spectral on Dec 3 2019, 8:35 PM.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

spectral created this revision.Dec 3 2019, 8:35 PM

I don't think this is correct, because open is imported from pycompat at the top of the file, and that will sysstr() the mode. But this does seem confusing- see D7517.

spectral retitled this revision from py3: remove incorrect b prefix on second argument to open in subrepo.py to subrepo: use pycompat.open directly instead of importing open from pycompat.Dec 4 2019, 1:16 AM
spectral updated this revision to Diff 18468.

I don't think this is correct, because open is imported from pycompat at the top of the file, and that will sysstr() the mode. But this does seem confusing- see D7517.

Ah, so it is. Since this is the only use of open in this file, I've switched to just using pycompat.open directly in this location. I'm also fine with just dropping this change.

dlax accepted this revision.Dec 4 2019, 3:46 AM
mharbison72 accepted this revision.Dec 4 2019, 7:32 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.