Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 435266

Summary: dev-vcs/mercurial-server-1.2 refresh-auth fails with a syntax error
Product: Gentoo Linux Reporter: Emmanuel Rosa <emmanuelrosa>
Component: New packagesAssignee: Rafael Martins (RETIRED) <rafaelmartins>
Status: RESOLVED DUPLICATE    
Severity: normal CC: emmanuelrosa
Priority: Normal Keywords: EBUILD, PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: mercurial-server/mercurial-server-1.2-r1.ebuild

Description Emmanuel Rosa 2012-09-16 21:30:25 UTC
When running /usr/share/mercurial-server/refresh-auth under the hg account the following error occurs:

$ /usr/share/mercurial-server/refresh-auth
Traceback (most recent call last):
  File "/usr/share/mercurial-server/refresh-auth", line 8, in <module>
    from mercurialserver import refreshauth, config
  File "/usr/lib/python3.2/site-packages/mercurialserver/refreshauth.py", line 10, in <module>
    from mercurialserver import config
  File "/usr/lib/python3.2/site-packages/mercurialserver/config.py", line 34
    except Exception, e:
                    ^
SyntaxError: invalid syntax

I think the problem is mercurial-server installed under Python 3.x, which has a different syntax for exception handling.

/usr/lib/python3.2/site-packages/mercurialserver
/usr/lib/python3.2/site-packages/mercurialserver/__init__.py
/usr/lib/python3.2/site-packages/mercurialserver/access.py
/usr/lib/python3.2/site-packages/mercurialserver/changes.py
/usr/lib/python3.2/site-packages/mercurialserver/config.py
/usr/lib/python3.2/site-packages/mercurialserver/refreshauth.py
/usr/lib/python3.2/site-packages/mercurialserver/ruleset.py
/usr/lib/python3.2/site-packages/mercurialserver/servelog.py

I checked the ebuild and it defines PYTHON_DEPEND="2" but it's missing RESTRICT_PYTHON_ABIS="3.*.
Comment 1 Emmanuel Rosa 2012-09-17 01:56:04 UTC
Created attachment 324054 [details]
mercurial-server/mercurial-server-1.2-r1.ebuild

Ebuild with a fix to not install into Python 3.x. I tried it and it worked.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-09-17 11:51:04 UTC
Comment on attachment 324054 [details]
mercurial-server/mercurial-server-1.2-r1.ebuild

--- mercurial-server-1.2.ebuild 2012-06-05 15:45:57.000000000 +0200
+++ -   2012-09-17 13:50:57.424414461 +0200
@@ -4,6 +4,8 @@
 
 EAPI="3"
 PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+RESTRICT_PYTHON_ABIS="3.*"
 
 inherit distutils eutils user
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-02-17 14:40:27 UTC
This is being handled as part of distutils-r1 conversion.

*** This bug has been marked as a duplicate of bug 541102 ***