Bug 1281826

Summary: [abrt] hamster-time-tracker: invalid syntax (hamster, line 165)
Product: [Fedora] Fedora Reporter: Francesco Frassinelli (frafra) <fraph24>
Component: hamster-time-trackerAssignee: Ankur Sinha (FranciscoD) <sanjay.ankur>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 23CC: fschwarz, projects.rg, sanjay.ankur
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/af05482000d5389fe4c0468445cc7dbc667651d7
Whiteboard: abrt_hash:17569b55cea6cb229996634b879cdc36510cd6cb;VARIANT_ID=workstation;
Fixed In Version: hamster-time-tracker-2.0-0.2.rc1.fc23 hamster-time-tracker-2.0-0.2.rc1.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-12 11:53:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Francesco Frassinelli (frafra) 2015-11-13 14:22:28 UTC
Version-Release number of selected component:
hamster-time-tracker-1.04-5.fc23

Additional info:
reporter:       libreport-2.6.2
cmdline:        python /usr/bin/hamster overview
executable:     /usr/bin/hamster
kernel:         4.2.5-300.fc23.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
invalid syntax (hamster, line 165)

  File "/usr/bin/hamster", line 165
    print "\n".join(formats)
             ^
SyntaxError: invalid syntax

Comment 1 Francesco Frassinelli (frafra) 2015-11-13 14:22:35 UTC
Created attachment 1093671 [details]
File: backtrace

Comment 2 Francesco Frassinelli (frafra) 2015-11-13 14:22:37 UTC
Created attachment 1093672 [details]
File: environ

Comment 3 Raphael Groner 2015-11-13 15:09:11 UTC
Maybe we want to try the release candidate of v2.0 from upstream?
https://github.com/projecthamster/hamster/releases/tag/v2.0-rc1

> type:           Python3
Why Python3? I do not see any support for Python3 at upstream. Did you change your local settings for the default python interpreter?

Comment 4 Felix Schwarz 2015-11-13 18:09:53 UTC
Likely a Python3 venv is active.

head /usr/bin/hamster
#!/usr/bin/env python
# - coding: utf-8 -

I think it's a common Fedora practice to replace the env call with "/usr/bin/python".

Comment 5 Francesco Frassinelli (frafra) 2015-11-13 18:17:51 UTC
Sorry, my fault, I switched over python3 by default (after updating to F23) because I thought it was the default interpreter for this version (https://fedoraproject.org/wiki/Changes/Python_3_as_Default).

Comment 6 Felix Schwarz 2015-11-13 19:23:47 UTC
(In reply to Francesco Frassinelli (frafra) from comment #5)
> Sorry, my fault,

I think the hamster package should be changed anyway because a venv is not guaranteed to have all required modules.

> I switched over python3 by default (after updating to F23)
> because I thought it was the default interpreter for this version
> (https://fedoraproject.org/wiki/Changes/Python_3_as_Default).

/usr/bin/python and "env python" should alway point to Python 2.x as recommended in PEP 0394 (also mentioned on the wiki page above) because just too many things break if you use Python 3 instead of Python 2.

Comment 7 Raphael Groner 2015-11-13 20:37:18 UTC
@Maintainer, please fix this as suggested in comment #4.

> %install
[…]
> sed -i -e '/^#!\//, 1d' %{buildroot}%{_bindir}/hamster
> sed -i -e '1i#!%{__python2}' %{buildroot}%{_bindir}/hamster

https://fedoraproject.org/wiki/Packaging_tricks#Remove_shebang_from_files
https://fedoraproject.org/wiki/Packaging_tricks#Add_shebang

Comment 8 Fedora Update System 2016-02-02 20:34:33 UTC
hamster-time-tracker-2.0-0.1.rc1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-401ab10316

Comment 9 Fedora Update System 2016-02-02 22:04:05 UTC
hamster-time-tracker-2.0-0.2.rc1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-01bd33e7e6

Comment 10 Fedora Update System 2016-02-02 22:04:06 UTC
hamster-time-tracker-2.0-0.2.rc1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-e7bfef7108

Comment 11 Fedora Update System 2016-02-03 23:01:15 UTC
hamster-time-tracker-2.0-0.2.rc1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-e7bfef7108

Comment 12 Fedora Update System 2016-02-03 23:25:48 UTC
hamster-time-tracker-2.0-0.2.rc1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-01bd33e7e6

Comment 13 Fedora Update System 2016-02-12 11:53:34 UTC
hamster-time-tracker-2.0-0.2.rc1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2016-02-12 12:21:18 UTC
hamster-time-tracker-2.0-0.2.rc1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.