Skip to content

Instantly share code, notes, and snippets.

@audreyfeldroy
Created September 7, 2013 15:55
Show Gist options
  • Save audreyfeldroy/6476750 to your computer and use it in GitHub Desktop.
Save audreyfeldroy/6476750 to your computer and use it in GitHub Desktop.
os.makedirs unicode error
python -m unittest tests.test_main.TestCookiecutterRepoArg
DEBUG: Making sure path exists: /Users/audreyr/.cookiecutters/
DEBUG: repo_dir is /Users/audreyr/.cookiecutters/cookiecutter-pypackage
Cloning into 'cookiecutter-pypackage'...
remote: Counting objects: 241, done.
remote: Compressing objects: 100% (130/130), done.
remote: Total 241 (delta 116), reused 206 (delta 98)
Receiving objects: 100% (241/241), 37.90 KiB, done.
Resolving deltas: 100% (116/116), done.
DEBUG: context_file is /Users/audreyr/.cookiecutters/cookiecutter-pypackage/cookiecutter.json
DEBUG: Context generated is {u'cookiecutter': OrderedDict([(u'full_name', u'Audrey Roy'), (u'email', u'audreyr@gmail.com'), (u'github_username', u'audreyr'), (u'project_name', u'Python Boilerplate'), (u'repo_name', u'boilerplate'), (u'project_short_description', u'Python Boilerplate contains all the boilerplate you need to create a Python package.'), (u'release_date', u'2013-08-11'), (u'year', u'2013'), (u'version', u'0.1.0')])}
DEBUG: Searching /Users/audreyr/.cookiecutters/cookiecutter-pypackage for the project template.
DEBUG: The project template appears to be /Users/audreyr/.cookiecutters/cookiecutter-pypackage/{{cookiecutter.repo_name}}
DEBUG: Generating project from /Users/audreyr/.cookiecutters/cookiecutter-pypackage/{{cookiecutter.repo_name}}...
DEBUG: Rendered dir must exist in output_dir .
DEBUG: Making sure path exists:
E
======================================================================
ERROR: test_cookiecutter_git (tests.test_main.TestCookiecutterRepoArg)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/audreyr/.virtualenvs/cookiecutter/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(*args, **keywargs)
File "tests/test_main.py", line 108, in test_cookiecutter_git
main.cookiecutter('https://github.com/audreyr/cookiecutter-pypackage.git')
File "cookiecutter/main.py", line 70, in cookiecutter
context=context
File "cookiecutter/generate.py", line 156, in generate_files
project_dir = render_and_create_dir(unrendered_dir, context, output_dir)
File "cookiecutter/generate.py", line 127, in render_and_create_dir
make_sure_path_exists(dir_to_create)
File "cookiecutter/utils.py", line 34, in make_sure_path_exists
os.makedirs(path)
File "/Users/audreyr/.virtualenvs/cookiecutter/bin/../lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
TypeError: must be encoded string without NULL bytes, not unicode
----------------------------------------------------------------------
Ran 1 test in 2.284s
FAILED (errors=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment