<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<div class="moz-cite-prefix">On 11/30/20 5:30 PM, Benny Bürger
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:f6bd2e1c1e3b4bf6b8e6069386461cac@simba.de">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I use the
pretxnchangegroup.check with a bash script.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The script executes but
the error code is ignored because of the following error:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite: Traceback
(most recent call last):<o:p></o:p></span></p>
<p class="MsoNormal">Gegenseite: File "/usr/local/bin/hg",
line 43, in <module><o:p></o:p></p>
<p class="MsoNormal">Gegenseite: dispatch.run()<o:p></o:p></p>
<p class="MsoNormal">Gegenseite: File
"/usr/lib/python3.8/importlib/util.py", line 245, in
__getattribute__<o:p></o:p></p>
<p class="MsoNormal">Gegenseite:
self.__spec__.loader.exec_module(self)<o:p></o:p></p>
<p class="MsoNormal">Gegenseite: File "<frozen
importlib._bootstrap_external>", line 783, in exec_module<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite: File
"<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite: File
"/usr/local/lib/python3.8/dist-packages/mercurial/dispatch.py",
line 22, in <module><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite: from
.i18n import _<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite: File
"/usr/lib/python3.8/importlib/util.py", line 245, in
__getattribute__<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite:
self.__spec__.loader.exec_module(self)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite: File
"/usr/local/lib/python3.8/dist-packages/mercurial/i18n.py",
line 15, in <module><o:p></o:p></span></p>
<p class="MsoNormal">Gegenseite: from .pycompat import
getattr<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">Gegenseite: ImportError:
cannot import name 'getattr' from 'mercurial.pycompat'
(/usr/local/lib/python3.8/dist-packages/mercurial/pycompat.py)
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Environment: Linux
repository 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10
10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">
I used pip to install Kallithea and all dependencies…</span></p>
</div>
</blockquote>
<p><br>
</p>
<p>Is the hook working when launched manually with python3?</p>
<p>It looks like a problem in the installation of /usr/local/bin/hg
. <span lang="EN-US">/usr/local/lib/python3.8/dist-packages/mercurial/pycompat.py
must be a version less than 5.2 if it doesn't have getattr .
That one year old version didn't have good support for Python 3.
I suggest using latest Mercurial version. Python3 support is
still improving.<br>
</span></p>
How was Kallithea installed? Using virtualenv?
<p>How was /usr/local/bin/hg installed?</p>
<p>Instead of installing in /usr/local , I would suggest using the
hg in the Kallithea virtualenv.</p>
<p>/Mads</p>
<br>
</body>
</html>