GothenburgBitFactory / tasklib

A Python library for interacting with taskwarrior databases.
http://tasklib.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
146 stars 27 forks source link

ASCII Conversion Problem when filtering tasks #37

Closed er4z0r closed 9 years ago

er4z0r commented 9 years ago

As suggested in #2 I am making this an extra issue.

I still have UTF-8 problems when filtering tasks using Python 2.7.9:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from tasklib.task import *

tw = TaskWarrior(data_location='~/.task', create=False)

local = tw.tasks.filter(description__contains=u'Täst')
print local 

Still gives me this:

Traceback (most recent call last):
  File "täst.py", line 7, in <module>
    local = tw.tasks.filter(description__contains=u'Täst')
  File "build/bdist.macosx-10.10-x86_64/egg/tasklib/task.py", line 843, in filter
  File "build/bdist.macosx-10.10-x86_64/egg/tasklib/task.py", line 743, in add_filter_param
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 2: ordinal not in range(128)

Did I do it wrong?

er4z0r commented 9 years ago

Fixed by @tbabej in 5c9fc321bdfb21abe02fe5df654778b7c7befb19