drivendataorg / cookiecutter-data-science

A logical, reasonably standardized, but flexible project structure for doing and sharing data science work.
https://cookiecutter-data-science.drivendata.org/
MIT License
8.32k stars 2.46k forks source link

ContextDecodingException #2

Closed jbencook closed 8 years ago

jbencook commented 8 years ago

When running cookiecutter https://github.com/drivendata/cookiecutter-data-science in Anaconda 2.3.0 (Python 2.7.11) I get the following exception:

Traceback (most recent call last):
  File "/Users/bencook/anaconda/bin/cookiecutter", line 11, in <module>
    sys.exit(main())
  File "/Users/bencook/anaconda/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/Users/bencook/anaconda/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/Users/bencook/anaconda/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/bencook/anaconda/lib/python2.7/site-packages/click-5.1-py2.7.egg/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/Users/bencook/anaconda/lib/python2.7/site-packages/cookiecutter/cli.py", line 106, in main
    config_file=user_config
  File "/Users/bencook/anaconda/lib/python2.7/site-packages/cookiecutter/main.py", line 130, in cookiecutter
    extra_context=extra_context,
  File "/Users/bencook/anaconda/lib/python2.7/site-packages/cookiecutter/generate.py", line 102, in generate_context
    raise ContextDecodingException(our_exc_message)
cookiecutter.exceptions.ContextDecodingException: JSON decoding error while loading "/Users/bencook/.cookiecutters/cookiecutter-data-science/cookiecutter.json".  Decoding error details: "Expecting property name: line 9 column 1 (char 401)"

I get the same exception in a virtual environment with Python 2.7.9.

Here's what my cookiecutter.json looks like:

{
    "project_name": "project_name",
    "repo_name": "{{ cookiecutter.project_name|replace(' ', '_') }}",
    "author_name": "Your name (or your organization/company/team)",
    "description": "A short description of the project.",
    "year": "2016",
    "open_source_license": ["MIT", "BSD", "Not open source"],
    "s3_bucket": "[OPTIONAL] your-bucket-for-syncing-data (do not include 's3://')",
}
pjbull commented 8 years ago

@jbencook Should be fixed with https://github.com/drivendata/cookiecutter-data-science/commit/ff0439f2cb4126128f069506353c3009970fa803

Would you mind confirming?

jbencook commented 8 years ago

:+1: that did it. Sneaky bug :)

pjbull commented 8 years ago

One day my text editor will yell at me about that before I save JSON with trailing commas....