-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup fails if default encoding != utf8 #127
Comments
From http://stackoverflow.com/a/11742928: The only supported default encodings in Python are: Python 2.x: ASCII If you change these, you are on your own and strange things will |
My proposal is not to change the default encoding in python, but maybe change the HISTORY.TXT file so it does not contain non-ascii characters to make the setup independent of the operating systems default encoding. |
The problem is, that the default encoding is changed. Look at the output of this on the machine you have problems on: import sys |
We live in 2013, unicode characters should work and people have a right to have their name written correctly. |
+1! |
Oh and just to be clear. I want to fix this, but not by using ascii only. So any help to let me reproduce this issue is highly appreciated. So far I couldn't find a way to break this on the machines I have access to. |
Yeah, I wouldn't be too happy with the "remove utf-8 characters from history.txt"... Anyhow, I created a test script for you at https://github.com/jajadinimueter/mr.developer-encoding-error.git I'm using ubuntu linux. This will create default freebsd locale settings and the install process will fail. |
This also happens with Debian systems.
For those systems we could just catch the error: diff --git a/setup.py b/setup.py
index 1ff0239..ac1f5ec 100644
--- a/setup.py
+++ b/setup.py
@@ -29,12 +29,19 @@ extra = {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
+long_description = ""
+try:
+ long_description = open("README.rst").read()\
+ + "\n\n"\
+ + open(os.path.join("docs", "HELP.txt")).read()\
+ + open(os.path.join("docs", "HISTORY.txt")).read()
+except UnicodeDecodeError:
+ pass
+
setup(name='mr.developer',
version=version,
description="A zc.buildout extension to ease the development of large projects with lots of packages.",
- long_description=open("README.rst").read() + "\n\n" +
- open(os.path.join("docs", "HELP.txt")).read() +
- open(os.path.join("docs", "HISTORY.txt")).read(),
+ long_description=long_description,
# Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
"Programming Language :: Python", |
This should now be fixed on master. Thanks for script jajadinimueter! |
Works for me! Even though my script did some things wrong it works never the less. Thank you very much! |
I fixed the script locally :) It was very helpful though, especially that it was easy to switch the python version. |
This is due to non-ascii characters in docs/HISTORY.txt.
The problem is, that even when we specify the encoding in setup.py the setup still fails because distutils does not care about encodings when writing package meta info. So I really don't know how to fix this.
The text was updated successfully, but these errors were encountered: