[Pythonmac-SIG] Py2app/Python 3.1 error

Aahz aahz at pythoncraft.com
Fri Jan 7 19:03:08 CET 2011


On Fri, Jan 07, 2011, Dan Ross wrote:
>
>  Has anyone seen this before?

No, but I can provide a clue...

>    File
>  "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/compat.py",
>  line 12, in B
>      return value.decode('latin1')
>  AttributeError: 'str' object has no attribute 'decode'
>
>  It's a simple little app using tkinter.

Python 3.1 strings don't have a decode method, so this is almost
certainly legacy code from Python 2.x that's trying to get from string to
unicode instead of going from bytes to string.

Python 3.1.2 (r312:79147, Mar 29 2010, 18:34:41) 
>>> ''.decode
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'decode'
>>> b''.decode
<built-in method decode of bytes object at 0xbb5399f8>

Any particular reason you're using 3.1 instead of 2.7?
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Think of it as evolution in action."  --Tony Rand


More information about the Pythonmac-SIG mailing list