##// END OF EJS Templates
py3: make i18n use encoding.environ
Yuya Nishihara -
r30035:02328b5d default
parent child Browse files
Show More
@@ -1,103 +1,104 b''
1 # i18n.py - internationalization support for mercurial
1 # i18n.py - internationalization support for mercurial
2 #
2 #
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import gettext as gettextmod
10 import gettext as gettextmod
11 import locale
11 import locale
12 import os
12 import os
13 import sys
13 import sys
14
14
15 from . import encoding
15 from . import encoding
16
16
17 # modelled after templater.templatepath:
17 # modelled after templater.templatepath:
18 if getattr(sys, 'frozen', None) is not None:
18 if getattr(sys, 'frozen', None) is not None:
19 module = sys.executable
19 module = sys.executable
20 else:
20 else:
21 module = __file__
21 module = __file__
22
22
23 try:
23 try:
24 unicode
24 unicode
25 except NameError:
25 except NameError:
26 unicode = str
26 unicode = str
27
27
28 _languages = None
28 _languages = None
29 if (os.name == 'nt'
29 if (os.name == 'nt'
30 and 'LANGUAGE' not in os.environ
30 and 'LANGUAGE' not in encoding.environ
31 and 'LC_ALL' not in os.environ
31 and 'LC_ALL' not in encoding.environ
32 and 'LC_MESSAGES' not in os.environ
32 and 'LC_MESSAGES' not in encoding.environ
33 and 'LANG' not in os.environ):
33 and 'LANG' not in encoding.environ):
34 # Try to detect UI language by "User Interface Language Management" API
34 # Try to detect UI language by "User Interface Language Management" API
35 # if no locale variables are set. Note that locale.getdefaultlocale()
35 # if no locale variables are set. Note that locale.getdefaultlocale()
36 # uses GetLocaleInfo(), which may be different from UI language.
36 # uses GetLocaleInfo(), which may be different from UI language.
37 # (See http://msdn.microsoft.com/en-us/library/dd374098(v=VS.85).aspx )
37 # (See http://msdn.microsoft.com/en-us/library/dd374098(v=VS.85).aspx )
38 try:
38 try:
39 import ctypes
39 import ctypes
40 langid = ctypes.windll.kernel32.GetUserDefaultUILanguage()
40 langid = ctypes.windll.kernel32.GetUserDefaultUILanguage()
41 _languages = [locale.windows_locale[langid]]
41 _languages = [locale.windows_locale[langid]]
42 except (ImportError, AttributeError, KeyError):
42 except (ImportError, AttributeError, KeyError):
43 # ctypes not found or unknown langid
43 # ctypes not found or unknown langid
44 pass
44 pass
45
45
46 _ugettext = None
46 _ugettext = None
47
47
48 def setdatapath(datapath):
48 def setdatapath(datapath):
49 localedir = os.path.join(datapath, 'locale')
49 localedir = os.path.join(datapath, 'locale')
50 t = gettextmod.translation('hg', localedir, _languages, fallback=True)
50 t = gettextmod.translation('hg', localedir, _languages, fallback=True)
51 global _ugettext
51 global _ugettext
52 try:
52 try:
53 _ugettext = t.ugettext
53 _ugettext = t.ugettext
54 except AttributeError:
54 except AttributeError:
55 _ugettext = t.gettext
55 _ugettext = t.gettext
56
56
57 _msgcache = {}
57 _msgcache = {}
58
58
59 def gettext(message):
59 def gettext(message):
60 """Translate message.
60 """Translate message.
61
61
62 The message is looked up in the catalog to get a Unicode string,
62 The message is looked up in the catalog to get a Unicode string,
63 which is encoded in the local encoding before being returned.
63 which is encoded in the local encoding before being returned.
64
64
65 Important: message is restricted to characters in the encoding
65 Important: message is restricted to characters in the encoding
66 given by sys.getdefaultencoding() which is most likely 'ascii'.
66 given by sys.getdefaultencoding() which is most likely 'ascii'.
67 """
67 """
68 # If message is None, t.ugettext will return u'None' as the
68 # If message is None, t.ugettext will return u'None' as the
69 # translation whereas our callers expect us to return None.
69 # translation whereas our callers expect us to return None.
70 if message is None or not _ugettext:
70 if message is None or not _ugettext:
71 return message
71 return message
72
72
73 if message not in _msgcache:
73 if message not in _msgcache:
74 if type(message) is unicode:
74 if type(message) is unicode:
75 # goofy unicode docstrings in test
75 # goofy unicode docstrings in test
76 paragraphs = message.split(u'\n\n')
76 paragraphs = message.split(u'\n\n')
77 else:
77 else:
78 paragraphs = [p.decode("ascii") for p in message.split('\n\n')]
78 paragraphs = [p.decode("ascii") for p in message.split('\n\n')]
79 # Be careful not to translate the empty string -- it holds the
79 # Be careful not to translate the empty string -- it holds the
80 # meta data of the .po file.
80 # meta data of the .po file.
81 u = u'\n\n'.join([p and _ugettext(p) or u'' for p in paragraphs])
81 u = u'\n\n'.join([p and _ugettext(p) or u'' for p in paragraphs])
82 try:
82 try:
83 # encoding.tolocal cannot be used since it will first try to
83 # encoding.tolocal cannot be used since it will first try to
84 # decode the Unicode string. Calling u.decode(enc) really
84 # decode the Unicode string. Calling u.decode(enc) really
85 # means u.encode(sys.getdefaultencoding()).decode(enc). Since
85 # means u.encode(sys.getdefaultencoding()).decode(enc). Since
86 # the Python encoding defaults to 'ascii', this fails if the
86 # the Python encoding defaults to 'ascii', this fails if the
87 # translated string use non-ASCII characters.
87 # translated string use non-ASCII characters.
88 _msgcache[message] = u.encode(encoding.encoding, "replace")
88 _msgcache[message] = u.encode(encoding.encoding, "replace")
89 except LookupError:
89 except LookupError:
90 # An unknown encoding results in a LookupError.
90 # An unknown encoding results in a LookupError.
91 _msgcache[message] = message
91 _msgcache[message] = message
92 return _msgcache[message]
92 return _msgcache[message]
93
93
94 def _plain():
94 def _plain():
95 if 'HGPLAIN' not in os.environ and 'HGPLAINEXCEPT' not in os.environ:
95 if ('HGPLAIN' not in encoding.environ
96 and 'HGPLAINEXCEPT' not in encoding.environ):
96 return False
97 return False
97 exceptions = os.environ.get('HGPLAINEXCEPT', '').strip().split(',')
98 exceptions = encoding.environ.get('HGPLAINEXCEPT', '').strip().split(',')
98 return 'i18n' not in exceptions
99 return 'i18n' not in exceptions
99
100
100 if _plain():
101 if _plain():
101 _ = lambda message: message
102 _ = lambda message: message
102 else:
103 else:
103 _ = gettext
104 _ = gettext
@@ -1,182 +1,178 b''
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ cd "$TESTDIR"/..
4 $ cd "$TESTDIR"/..
5
5
6 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
6 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
7 hgext/fsmonitor/pywatchman/__init__.py not using absolute_import
7 hgext/fsmonitor/pywatchman/__init__.py not using absolute_import
8 hgext/fsmonitor/pywatchman/__init__.py requires print_function
8 hgext/fsmonitor/pywatchman/__init__.py requires print_function
9 hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
9 hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
10 hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
10 hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
11 i18n/check-translation.py not using absolute_import
11 i18n/check-translation.py not using absolute_import
12 setup.py not using absolute_import
12 setup.py not using absolute_import
13 tests/test-demandimport.py not using absolute_import
13 tests/test-demandimport.py not using absolute_import
14
14
15 #if py3exe
15 #if py3exe
16 $ hg files 'set:(**.py) - grep(pygments)' | sed 's|\\|/|g' \
16 $ hg files 'set:(**.py) - grep(pygments)' | sed 's|\\|/|g' \
17 > | xargs $PYTHON3 contrib/check-py3-compat.py \
17 > | xargs $PYTHON3 contrib/check-py3-compat.py \
18 > | sed 's/[0-9][0-9]*)$/*)/'
18 > | sed 's/[0-9][0-9]*)$/*)/'
19 doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *)
19 doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *)
20 hgext/acl.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
20 hgext/acl.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
21 hgext/automv.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
21 hgext/automv.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
22 hgext/blackbox.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
22 hgext/blackbox.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
23 hgext/bugzilla.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
23 hgext/bugzilla.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
24 hgext/censor.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
24 hgext/censor.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
25 hgext/chgserver.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
25 hgext/chgserver.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
26 hgext/children.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
26 hgext/children.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
27 hgext/churn.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
27 hgext/churn.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
28 hgext/clonebundles.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
28 hgext/clonebundles.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
29 hgext/color.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
29 hgext/color.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
30 hgext/convert/bzr.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
30 hgext/convert/bzr.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *)
31 hgext/convert/common.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
31 hgext/convert/common.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
32 hgext/convert/convcmd.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
32 hgext/convert/convcmd.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
33 hgext/convert/cvs.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
33 hgext/convert/cvs.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
34 hgext/convert/cvsps.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
34 hgext/convert/cvsps.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
35 hgext/convert/darcs.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
35 hgext/convert/darcs.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
36 hgext/convert/filemap.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
36 hgext/convert/filemap.py: error importing module: <SystemError> Parent module 'hgext.convert' not loaded, cannot perform relative import (line *)
37 hgext/convert/git.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
37 hgext/convert/git.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
38 hgext/convert/gnuarch.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
38 hgext/convert/gnuarch.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
39 hgext/convert/hg.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
39 hgext/convert/hg.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
40 hgext/convert/monotone.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
40 hgext/convert/monotone.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
41 hgext/convert/p4.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
41 hgext/convert/p4.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
42 hgext/convert/subversion.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
42 hgext/convert/subversion.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
43 hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *)
43 hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *)
44 hgext/eol.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
44 hgext/eol.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
45 hgext/extdiff.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
45 hgext/extdiff.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
46 hgext/factotum.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
46 hgext/factotum.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
47 hgext/fetch.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
47 hgext/fetch.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
48 hgext/fsmonitor/state.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
48 hgext/fsmonitor/state.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
49 hgext/fsmonitor/watchmanclient.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
49 hgext/fsmonitor/watchmanclient.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
50 hgext/gpg.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
50 hgext/gpg.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
51 hgext/graphlog.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
51 hgext/graphlog.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
52 hgext/hgk.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
52 hgext/hgk.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
53 hgext/histedit.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
53 hgext/histedit.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
54 hgext/journal.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
54 hgext/journal.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
55 hgext/keyword.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
55 hgext/keyword.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
56 hgext/largefiles/basestore.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
56 hgext/largefiles/basestore.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
57 hgext/largefiles/lfcommands.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
57 hgext/largefiles/lfcommands.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
58 hgext/largefiles/lfutil.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
58 hgext/largefiles/lfutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
59 hgext/largefiles/localstore.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
59 hgext/largefiles/localstore.py: error importing module: <SystemError> Parent module 'hgext.largefiles' not loaded, cannot perform relative import (line *)
60 hgext/largefiles/overrides.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
60 hgext/largefiles/overrides.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
61 hgext/largefiles/proto.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
61 hgext/largefiles/proto.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
62 hgext/largefiles/remotestore.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
62 hgext/largefiles/remotestore.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
63 hgext/largefiles/reposetup.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
63 hgext/largefiles/reposetup.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
64 hgext/largefiles/storefactory.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
64 hgext/largefiles/storefactory.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
65 hgext/largefiles/uisetup.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
65 hgext/largefiles/uisetup.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
66 hgext/largefiles/wirestore.py: error importing module: <SystemError> Parent module 'hgext.largefiles' not loaded, cannot perform relative import (line *)
66 hgext/largefiles/wirestore.py: error importing module: <SystemError> Parent module 'hgext.largefiles' not loaded, cannot perform relative import (line *)
67 hgext/mq.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
67 hgext/mq.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
68 hgext/notify.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
68 hgext/notify.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
69 hgext/pager.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
69 hgext/pager.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
70 hgext/patchbomb.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
70 hgext/patchbomb.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
71 hgext/purge.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
71 hgext/purge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
72 hgext/rebase.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
72 hgext/rebase.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
73 hgext/record.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
73 hgext/record.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
74 hgext/relink.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
74 hgext/relink.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
75 hgext/schemes.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
75 hgext/schemes.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
76 hgext/share.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
76 hgext/share.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
77 hgext/shelve.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
77 hgext/shelve.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
78 hgext/strip.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
78 hgext/strip.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
79 hgext/transplant.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
79 hgext/transplant.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
80 hgext/win32mbcs.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
80 hgext/win32text.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
81 hgext/win32text.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
81 mercurial/archival.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
82 mercurial/archival.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
82 mercurial/bookmarks.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
83 mercurial/bookmarks.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
83 mercurial/branchmap.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
84 mercurial/branchmap.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
84 mercurial/bundle2.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
85 mercurial/bundle2.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
85 mercurial/bundlerepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
86 mercurial/bundlerepo.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
86 mercurial/byterange.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
87 mercurial/byterange.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
87 mercurial/changegroup.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
88 mercurial/changegroup.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
88 mercurial/changelog.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
89 mercurial/changelog.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
89 mercurial/cmdutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
90 mercurial/cmdutil.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
90 mercurial/commands.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
91 mercurial/commands.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
91 mercurial/commandserver.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
92 mercurial/commandserver.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
92 mercurial/config.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
93 mercurial/config.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
93 mercurial/context.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
94 mercurial/context.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
94 mercurial/copies.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
95 mercurial/copies.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
95 mercurial/crecord.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
96 mercurial/crecord.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
96 mercurial/destutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
97 mercurial/dagparser.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
97 mercurial/dirstate.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
98 mercurial/dagutil.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
98 mercurial/discovery.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
99 mercurial/destutil.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
99 mercurial/dispatch.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
100 mercurial/dirstate.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
101 mercurial/discovery.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
102 mercurial/dispatch.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
103 mercurial/encoding.py: error importing module: <TypeError> bytes expected, not str (line *)
100 mercurial/encoding.py: error importing module: <TypeError> bytes expected, not str (line *)
104 mercurial/exchange.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
101 mercurial/exchange.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
105 mercurial/extensions.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
102 mercurial/extensions.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
106 mercurial/fancyopts.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
103 mercurial/filelog.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
107 mercurial/filelog.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
104 mercurial/filemerge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
108 mercurial/filemerge.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
105 mercurial/fileset.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
109 mercurial/fileset.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
106 mercurial/formatter.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
110 mercurial/formatter.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
107 mercurial/graphmod.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
111 mercurial/graphmod.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
108 mercurial/help.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
112 mercurial/hbisect.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
109 mercurial/hg.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
113 mercurial/help.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
114 mercurial/hg.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
115 mercurial/hgweb/common.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
110 mercurial/hgweb/common.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
116 mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
111 mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
117 mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
112 mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
118 mercurial/hgweb/protocol.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
113 mercurial/hgweb/protocol.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
119 mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
114 mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
120 mercurial/hgweb/server.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
115 mercurial/hgweb/server.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
121 mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
116 mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
122 mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
117 mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
123 mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
118 mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *)
124 mercurial/hook.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
119 mercurial/hook.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
125 mercurial/httpconnection.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
120 mercurial/httpconnection.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
126 mercurial/httppeer.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
121 mercurial/httppeer.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
122 mercurial/i18n.py: error importing module: <TypeError> bytes expected, not str (line *)
127 mercurial/keepalive.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
123 mercurial/keepalive.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
128 mercurial/localrepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
124 mercurial/localrepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
129 mercurial/lock.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
125 mercurial/lock.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
130 mercurial/mail.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
126 mercurial/mail.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
131 mercurial/manifest.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
127 mercurial/manifest.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
132 mercurial/match.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
128 mercurial/match.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
133 mercurial/mdiff.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
129 mercurial/mdiff.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
134 mercurial/merge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
130 mercurial/merge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
135 mercurial/minirst.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
131 mercurial/minirst.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
136 mercurial/namespaces.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
132 mercurial/namespaces.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
137 mercurial/obsolete.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
133 mercurial/obsolete.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
138 mercurial/patch.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
134 mercurial/patch.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
139 mercurial/pathutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
135 mercurial/pathutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
140 mercurial/peer.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
136 mercurial/peer.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
141 mercurial/profiling.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
137 mercurial/profiling.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
142 mercurial/pushkey.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
138 mercurial/pushkey.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
143 mercurial/pvec.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
139 mercurial/pvec.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
144 mercurial/registrar.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
140 mercurial/registrar.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
145 mercurial/repair.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
141 mercurial/repair.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
146 mercurial/repoview.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
142 mercurial/repoview.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
147 mercurial/revlog.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
143 mercurial/revlog.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
148 mercurial/revset.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
144 mercurial/revset.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
149 mercurial/scmutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
145 mercurial/scmutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
150 mercurial/scmwindows.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
146 mercurial/scmwindows.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
151 mercurial/similar.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
147 mercurial/similar.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
152 mercurial/simplemerge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
148 mercurial/simplemerge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
153 mercurial/sshpeer.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
149 mercurial/sshpeer.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
154 mercurial/sshserver.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
150 mercurial/sshserver.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
155 mercurial/sslutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
151 mercurial/sslutil.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
156 mercurial/statichttprepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
152 mercurial/statichttprepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
157 mercurial/store.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
153 mercurial/store.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
158 mercurial/streamclone.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
154 mercurial/streamclone.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
159 mercurial/subrepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
155 mercurial/subrepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
160 mercurial/tagmerge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
156 mercurial/tagmerge.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
161 mercurial/tags.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
157 mercurial/tags.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
162 mercurial/templatefilters.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
158 mercurial/templatefilters.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
163 mercurial/templatekw.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
159 mercurial/templatekw.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
164 mercurial/templater.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
160 mercurial/templater.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
165 mercurial/transaction.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
161 mercurial/transaction.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
166 mercurial/ui.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
162 mercurial/ui.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
167 mercurial/unionrepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
163 mercurial/unionrepo.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
168 mercurial/url.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
164 mercurial/url.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
169 mercurial/util.py: error importing module: <TypeError> encode() argument 1 must be str, not bytes (line *)
165 mercurial/util.py: error importing: <TypeError> encode() argument 1 must be str, not bytes (error at i18n.py:*)
170 mercurial/verify.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
166 mercurial/verify.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
171 mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
167 mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
172 mercurial/windows.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
168 mercurial/windows.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
173 mercurial/wireproto.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
169 mercurial/wireproto.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
174
170
175 #endif
171 #endif
176
172
177 #if py3exe py3pygments
173 #if py3exe py3pygments
178 $ hg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \
174 $ hg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \
179 > | xargs $PYTHON3 contrib/check-py3-compat.py \
175 > | xargs $PYTHON3 contrib/check-py3-compat.py \
180 > | sed 's/[0-9][0-9]*)$/*)/'
176 > | sed 's/[0-9][0-9]*)$/*)/'
181 hgext/highlight/highlight.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*)
177 hgext/highlight/highlight.py: error importing: <TypeError> __slots__ items must be strings, not 'bytes' (error at util.py:*)
182 #endif
178 #endif
General Comments 0
You need to be logged in to leave comments. Login now