Issue 33 in goobook: Encoding issues on OS X with MacPorts Python 2.7

10 views
Skip to first unread message

goo...@googlecode.com

unread,
Mar 29, 2012, 12:34:46 PM3/29/12
to goobook...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

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


goo...@googlecode.com

unread,
Mar 29, 2012, 12:39:51 PM3/29/12
to goobook...@googlegroups.com

Comment #1 on 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

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

goo...@googlecode.com

unread,
Apr 9, 2012, 3:31:40 PM4/9/12
to goobook...@googlegroups.com

Comment #2 on issue 33 by h...@furuvik.net: Encoding issues on OS X with

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.

goo...@googlecode.com

unread,
Apr 9, 2012, 3:52:46 PM4/9/12
to goobook...@googlegroups.com
Updates:
Status: Fixed

Comment #3 on issue 33 by h...@furuvik.net: Encoding issues on OS X with

Encoding issue fixed in GIT

Reply all
Reply to author
Forward
0 new messages