New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TI-48] Timewarrior hook is not Python3 compatible #53

Closed
taskwarrior opened this Issue Feb 11, 2018 · 4 comments

Comments

Projects
None yet
1 participant
@taskwarrior

taskwarrior commented Feb 11, 2018

Josh Proehl on 2016-09-21T16:45:56Z says:

Given a user has the timewarrior hook installed and "/usr/bin/env python" returns python3, then attempting a "task ID start" throws the following error:

Traceback (most recent call last):
  File "/home/joshproehl/.task/hooks/on-modify.timewarrior", line 57, in <module>
    os.system('timew start ' + combined + ' :yes')
TypeError: Can't convert 'bytes' object to str implicitly
Hook Error: Expected feedback from a failing hook script.

This can be resolved by changing the on-modify.timewarrior script to use "/usr/bin/env python2", indicating the problem is a python3 incompatibility.

(totals.py also appears to be python2 only)

@taskwarrior taskwarrior added this to the 1.1.0 milestone Feb 11, 2018

@taskwarrior

This comment has been minimized.

taskwarrior commented Feb 11, 2018

Migrated metadata:

Created: 2016-09-21T16:45:56Z
Modified: 2017-02-25T19:18:15Z
@taskwarrior

This comment has been minimized.

taskwarrior commented Feb 11, 2018

Paul Beckingham on 2016-09-22T12:16:24Z says:

Thank you.

@taskwarrior

This comment has been minimized.

taskwarrior commented Feb 11, 2018

Amado Martinez on 2016-11-15T15:33:21Z says:

I am not a python developer so I'm not sure if the following solution is backwards compatible with python2, but here it is:

Without changing the env-python line:

57c57
< os.system('timew start ' + combined + ' :yes')

  • --

os.system('timew start ' + combined.decode() + ' :yes')
61c61
< os.system('timew stop ' + combined + ' :yes')

  • --

os.system('timew stop ' + combined.decode() + ' :yes')

@taskwarrior

This comment has been minimized.

taskwarrior commented Feb 11, 2018

Paul Beckingham on 2017-02-25T19:18:15Z says:

Thanks Josh and Armado.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment