From 67f68d22345d966a44c89aad640010d509ae643e Mon Sep 17 00:00:00 2001 From: Christian Boos Date: Mon, 18 Feb 2013 20:51:06 +0100 Subject: [PATCH 1/3] Fix setup.py so that bdist_wininst works. Leaving the maintainer's name as a string (as opposed to a unicode) was triggering a UnicodeDecodeError when running bdist_wininst with Python 2.7.3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b4daa38..52d8ed9 100644 --- a/setup.py +++ b/setup.py @@ -171,7 +171,7 @@ setup(name='pygit2', url='http://github.com/libgit2/pygit2', classifiers=classifiers, license='GPLv2', - maintainer='J. David Ibáñez', + maintainer=u'J. David Ibáñez', maintainer_email='jdavid.ibp@gmail.com', long_description=long_description, packages = ['pygit2'], From c4fa231df3b2f4996ad1b16cdab5d1dc01f98acc Mon Sep 17 00:00:00 2001 From: Christian Boos Date: Mon, 18 Feb 2013 20:58:43 +0100 Subject: [PATCH 2/3] setup: Emacs actually don't like UTF-8, prefers utf-8 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 52d8ed9..0aa2930 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- # coding: UTF-8 # # Copyright 2010-2012 The pygit2 contributors From bcf48321eeb58f40b367d2549581cb5f38c3f464 Mon Sep 17 00:00:00 2001 From: Christian Boos Date: Mon, 18 Feb 2013 21:03:19 +0100 Subject: [PATCH 3/3] setup: using u'...' breaks for Python 3.[0-2]. --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0aa2930..819129b 100644 --- a/setup.py +++ b/setup.py @@ -44,6 +44,8 @@ from distutils import log sys.path.insert(0, 'pygit2') from version import __version__ +u = lambda s: s if sys.version_info[0] > 2 else unicode(s, 'utf-8') + # Use environment variable LIBGIT2 to set your own libgit2 configuration. libgit2_path = os.getenv("LIBGIT2") @@ -171,7 +173,7 @@ setup(name='pygit2', url='http://github.com/libgit2/pygit2', classifiers=classifiers, license='GPLv2', - maintainer=u'J. David Ibáñez', + maintainer=u('J. David Ibáñez'), maintainer_email='jdavid.ibp@gmail.com', long_description=long_description, packages = ['pygit2'],