Skip to content

Commit

Permalink
Merge branch '2636-fix-encoding-create-ext'
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Sep 22, 2015
2 parents 0ad2f8a + 6296d88 commit 9f4de38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ckan/pastertemplates/__init__.py
Expand Up @@ -51,6 +51,11 @@ class CkanextTemplate(Template):
def check_vars(self, vars, cmd):
vars = Template.check_vars(self, vars, cmd)

# workaround for a paster issue https://github.com/ckan/ckan/issues/2636
# this is only used from a short-lived paster command
reload(sys)
sys.setdefaultencoding('utf-8')

if not vars['project'].startswith('ckanext-'):
print "\nError: Project name must start with 'ckanext-'"
sys.exit(1)
Expand All @@ -63,7 +68,7 @@ def check_vars(self, vars, cmd):
keywords = [keyword for keyword in keywords
if keyword not in ('ckan', 'CKAN')]
keywords.insert(0, 'CKAN')
vars['keywords'] = ' '.join(keywords)
vars['keywords'] = u' '.join(keywords)

# For an extension named ckanext-example we want a plugin class
# named ExamplePlugin.
Expand Down
1 change: 1 addition & 0 deletions ckan/pastertemplates/template/setup.py_tmpl
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
Expand Down

0 comments on commit 9f4de38

Please sign in to comment.