New issue 33 by christoph.s...@gmail.com: Encoding issues on OS X
with MacPorts Python 2.7
http://code.google.com/p/goobook/issues/detail?id=33
What steps will reproduce the problem?
1. Install goobook with pip-2.7 using MacPorts Python 2.7
2. Run goobook
What is the expected output? What do you see instead?
Should print usage information to stdout. Instead, I get lots of error
messages because the goobook entry script calls system python:
#!/usr/bin/python
The fix is to ask /usr/bin/env which python to call:
#!/usr/bin/env python
The next problem is that
>>> locale.getpreferredencoding()
''
Returns an empty string. The fix is to check for an empty string and force
the encoding to 'UTF-8' in that case; i.e. insert at L29 in application.py:
if encoding == '':
encoding = 'UTF-8'
What version of the product are you using? On what operating system?
1.4alpha4
OS X 10.7.3
MacPorts 2.0.4
MacPorts Python 2.7.2 installed to /opt/local/bin/python
The "/usr/bin/python" problem appears to be fixed in the git repository.
The attached patch against the git repository fixes the empty string
returned by locale.getpreferredencoding().
Attachments:
encoding.patch 618 bytes
The "#!/usr/bin/python" part of the problem
This problem is caused (probably) by that you installed goobook with
/usr/bin/python
then it will use it.
Ensure that the correct python is used when installing.
Comment #3 on issue 33 by h...@furuvik.net: Encoding issues on OS X with
MacPorts Python 2.7
http://code.google.com/p/goobook/issues/detail?id=33
Encoding issue fixed in GIT