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

Already on GitHub? Sign in to your account

Python3 compatibility #9

Closed
n1k0 opened this Issue Oct 8, 2012 · 6 comments

Comments

Projects
None yet
2 participants
Collaborator

n1k0 commented Oct 8, 2012

No description provided.

@n1k0 n1k0 referenced this issue Oct 8, 2012

Closed

Add travis-ci hook #8

Owner

Lothiraldan commented Oct 8, 2012

All tests are green with 2to3 applied, will commit.

Collaborator

n1k0 commented Oct 8, 2012

Well, tests are broken under 2.7 now:

$ python --version
Python 2.7.3
$ bin/onetask test
EEEEE
======================================================================
ERROR: test_add (onetask.tests.TaskCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 24, in test_add
    tasks = self._load(tasks=[])
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 13, in _load
    temp.write(bytes(json.dumps(dict(**kwargs)), 'UTF-8'))
TypeError: str() takes at most 1 argument (2 given)

======================================================================
ERROR: test_done (onetask.tests.TaskCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 50, in test_done
    tasks = self._load(tasks=[], current=None, archive=[])
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 13, in _load
    temp.write(bytes(json.dumps(dict(**kwargs)), 'UTF-8'))
TypeError: str() takes at most 1 argument (2 given)

======================================================================
ERROR: test_get (onetask.tests.TaskCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 37, in test_get
    current=None, archive=[])
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 13, in _load
    temp.write(bytes(json.dumps(dict(**kwargs)), 'UTF-8'))
TypeError: str() takes at most 1 argument (2 given)

======================================================================
ERROR: test_load (onetask.tests.TaskCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 18, in test_load
    tasks = self._load(tasks=[{"title": "task1"}, {"title": "task2"}])
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 13, in _load
    temp.write(bytes(json.dumps(dict(**kwargs)), 'UTF-8'))
TypeError: str() takes at most 1 argument (2 given)

======================================================================
ERROR: test_skip (onetask.tests.TaskCollectionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 74, in test_skip
    current=None)
  File "/Users/niko/Sites/OneTask/onetask/tests.py", line 13, in _load
    temp.write(bytes(json.dumps(dict(**kwargs)), 'UTF-8'))
TypeError: str() takes at most 1 argument (2 given)

----------------------------------------------------------------------
Ran 5 tests in 0.003s

FAILED (errors=5)
Owner

Lothiraldan commented Oct 8, 2012

Fixed in e1f149d

Collaborator

n1k0 commented Oct 8, 2012

The cli's still broken under 2.7:

$ bin/onetask add "plop"  
Traceback (most recent call last):
  File "bin/onetask", line 53, in <module>
    args.func(str(args.task, "utf-8"))
TypeError: str() takes at most 1 argument (2 given)

@n1k0 n1k0 reopened this Oct 8, 2012

@n1k0 n1k0 closed this in 9fea8bc Oct 8, 2012

Collaborator

n1k0 commented Oct 8, 2012

I've added tests for direct cli use.

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