Patchwork [1,of,2] py3: open extension source in binary mode to read docstring as bytes

login
register
mail settings
Submitter Yuya Nishihara
Date June 17, 2018, 9:11 a.m.
Message ID <2c1d983872f6049c73be.1529226693@mimosa>
Download mbox | patch
Permalink /patch/32212/
State Accepted
Headers show

Comments

Yuya Nishihara - June 17, 2018, 9:11 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1529225952 -32400
#      Sun Jun 17 17:59:12 2018 +0900
# Node ID 2c1d983872f6049c73be18d5d9da938b1d61f8fd
# Parent  b8f45fc27370dc7df283c47f71927c10462197fb
py3: open extension source in binary mode to read docstring as bytes

Patch

diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -605,7 +605,7 @@  def _moduledoc(file):
 def _disabledhelp(path):
     '''retrieve help synopsis of a disabled extension (without importing)'''
     try:
-        file = open(path)
+        file = open(path, 'rb')
     except IOError:
         return
     else: