Problemi con il messaggio Trac impegnano sceneggiatura (SyntaxError: sintassi non valida)
-
19-09-2019 - |
Domanda
Ho installato un post commettere sceneggiatura trovato alla http : //trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook per associare gruppi di modifiche con i biglietti
Quando provo a commettere, ottengo il seguente errore
'post-commit' hook failed with error output:
File "/var/www/svn/repo/hooks/trac-post-commit-hook", line 101
(options, args) = parser.parse_args(sys.argv[1:])
^
SyntaxError: invalid syntax
I'm running Python 2.4.3 on CentOS.
I'm not familiar with Python, so I can't really tell whats happening here and no one seems to have had this issue before (according to Google).
I was hoping someone here would know what's going on.
Thanks in advance.
EDIT:
If it helps, here is my post-commit script
REPOS="$1"
REV="$2"
LOG='/usr/bin/svnlook log -r $REV $REPOS'
AUTHOR='/usr/bin/svnlook author -r $REV $REPOS'
TRAC_ENV="/var/www/trac/[xxx]/"
TRAC_URL='http://trac.[xxx].com/'
/usr/bin/python /var/www/svn/repo/hooks/trac-post-commit-hook -p "$TRAC_ENV" -r "$REV" -u "$AUTHOR" -m "$LOG" -s "$TRAC_URL"
Soluzione
Può essere che si dispone di spazio o di scheda prima (opzioni, args)? può essere come questo.
>>> (options, args) = parser.parse_args(sys.argv[1:])
>>> # this is fine
>>>
>>> (options, args) = parser.parse_args(sys.argv[1:])
File "<stdin>", line 1
(options, args) = parser.parse_args(sys.argv[1:])
^
SyntaxError: invalid syntax
>>>
Altri suggerimenti
Wow, questo è strano. La linea è sicuramente sintassi valida, e la versione di Python dovrebbe anche non essere un problema in quanto dichiarazione di copyright dello script ha lo stesso anno Python 2.4 è stato rilasciato nel. Avete più installazioni Python sulla vostra macchina? Se è così, si può verificare se /usr/bin/env python
restituisce il corretto?