Repository: getnikola/nikola

Issue:
task_create_bundles is delivering some attributes as unicode instead of str
When run nikola build in a fresh site generated with nikola init command, the output is:

```
Scanning posts 
.
.
done!
ERROR: Task 'build_bundles:output/assets/css/all.css' attribute 'name' must be {str} got:u'build_bundles:output/assets/css/all.css' <type 'unicode'>
```

How reproduce:

```
$ nikola init foobar
$ cd foobar
$ nikola build
```

A clue:
If you comment the line "from **future** import unicode_literals" in the conf.py file, it works well.



Discussion:
On Sat, Jan 5, 2013 at 1:14 AM, agustinhenze notifications@github.comwrote:

> When run nikola build in a fresh site generated with nikola init command,
> the output is:
> 
> Scanning posts
> .
> .
> done!
> ERROR: Task 'build_bundles:output/assets/css/all.css' attribute 'name' must be {str} got:u'build_bundles:output/assets/css/all.css' <type 'unicode'>
> 
> How reproduce:
> 
> $ nikola init foobar
> $ cd foobar
> $ nikola build
> 
> A clue:
> If you comment the line "from _future_ import unicode_literals" in the
> conf.py file, it works well.
> 
> I guess this should be fixed in doit trunk. I will update the docs and push
> a new release...
> can you please double check latest doit (trunk) fix the problem.
> https://bitbucket.org/schettino72/doit

Great! with the last version of doit it works, but now I get other error.

```
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/doit/doit_cmd.py", line 102, in run
    return self.sub_cmds[command].parse_execute(args)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 58, in parse_execute
    return self.execute(params, args)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 223, in execute
    return self._execute(**exec_params)
  File "/usr/local/lib/python2.7/dist-packages/doit/cmd_run.py", line 155, in _execute
    return runner.run_all(self.control.task_dispatcher())
  File "/usr/local/lib/python2.7/dist-packages/doit/runner.py", line 233, in run_all
    self.run_tasks(task_dispatcher)
  File "/usr/local/lib/python2.7/dist-packages/doit/runner.py", line 198, in run_tasks
    if not self.select_task(node, task_dispatcher.tasks):
  File "/usr/local/lib/python2.7/dist-packages/doit/runner.py", line 109, in select_task
    if node.ignored_deps or self.dep_manager.status_is_ignore(task):
  File "/usr/local/lib/python2.7/dist-packages/doit/dependency.py", line 330, in status_is_ignore
    return self._get(task.name, "ignore:")
  File "/usr/local/lib/python2.7/dist-packages/doit/dependency.py", line 205, in get
    task_data = self._dbm[task_id]
  File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in __getitem__
    return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
  File "/usr/lib/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap
    return function(*_args, **_kwargs)
  File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in <lambda>
    return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
TypeError: String or Integer object expected for key, unicode found
```

Seems a similar problem

On Sat, Jan 5, 2013 at 4:31 AM, agustinhenze notifications@github.comwrote:

> Great! with the last version of doit it works, but now I get other error.
> 
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.7/dist-packages/doit/doit_cmd.py", line 102, in run
>     return self.sub_cmds[command].parse_execute(args)
>   File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 58, in parse_execute
>     return self.execute(params, args)
>   File "/usr/local/lib/python2.7/dist-packages/doit/cmd_base.py", line 223, in execute
>     return self._execute(**exec_params)
>   File "/usr/local/lib/python2.7/dist-packages/doit/cmd_run.py", line 155, in _execute
>     return runner.run_all(self.control.task_dispatcher())
>   File "/usr/local/lib/python2.7/dist-packages/doit/runner.py", line 233, in run_all
>     self.run_tasks(task_dispatcher)
>   File "/usr/local/lib/python2.7/dist-packages/doit/runner.py", line 198, in run_tasks
>     if not self.select_task(node, task_dispatcher.tasks):
>   File "/usr/local/lib/python2.7/dist-packages/doit/runner.py", line 109, in select_task
>     if node.ignored_deps or self.dep_manager.status_is_ignore(task):
>   File "/usr/local/lib/python2.7/dist-packages/doit/dependency.py", line 330, in status_is_ignore
>     return self._get(task.name, "ignore:")
>   File "/usr/local/lib/python2.7/dist-packages/doit/dependency.py", line 205, in get
>     task_data = self._dbm[task_id]
>   File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in **getitem**
>     return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
>   File "/usr/lib/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap
>     return function(__args, *__kwargs)
>   File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in <lambda>
>     return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
> TypeError: String or Integer object expected for key, unicode found
> 
> Seems a similar problem
> 
> now was dbm module that couldnt handle unicode keys on python2...
> I just commited a work around in doit.

cheers

@agustinhenze  did you test it? can we close this?

Hey schettino! I'm testing right now and it works. Thanks for the great job!


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -29,7 +29,7 @@
     from distutils.util import convert_path
 
 dependencies = [
-    'doit>=0.18.1',
+    'doit>=0.20.0',
     'pygments',
     'pillow',
     'docutils',


Test patch: