Patchwork D2153: py3: open patches.queue in binary mode

login
register
mail settings
Submitter phabricator
Date Feb. 13, 2018, 2:47 a.m.
Message ID <d8930a29832613fc1f1b1d707b421627@localhost.localdomain>
Download mbox | patch
Permalink /patch/27763/
State Not Applicable
Headers show

Comments

phabricator - Feb. 13, 2018, 2:47 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbff95b002e33: py3: open patches.queue in binary mode (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2153?vs=5454&id=5578

REVISION DETAIL
  https://phab.mercurial-scm.org/D2153

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, pulkit, durin42
Cc: mercurial-devel

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -445,9 +445,9 @@ 
     def __init__(self, ui, baseui, path, patchdir=None):
         self.basepath = path
         try:
-            fh = open(os.path.join(path, 'patches.queue'))
-            cur = fh.read().rstrip()
-            fh.close()
+            with open(os.path.join(path, 'patches.queue'), r'rb') as fh:
+                cur = fh.read().rstrip()
+
             if not cur:
                 curpath = os.path.join(path, 'patches')
             else: