[Pythonmac-SIG] Pythonmac-SIG Digest, Vol 93, Issue 5
Dan Ross
dan at rosspixelworks.com
Sat Jan 8 15:38:21 CET 2011
Hey Aahz-
Just thought I'd try porting a little utility from 2.7 to 3.1 for kicks.
On Jan 8, 2011, at 5:00 AM, pythonmac-sig-request at python.org wrote:
> Send Pythonmac-SIG mailing list submissions to
> pythonmac-sig at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mail.python.org/mailman/listinfo/pythonmac-sig
> or, via email, send a message with subject or body 'help' to
> pythonmac-sig-request at python.org
>
> You can reach the person managing the list at
> pythonmac-sig-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Pythonmac-SIG digest..."
> Today's Topics:
>
> 1. Py2app/Python 3.1 error (Dan Ross)
> 2. Re: Py2app/Python 3.1 error (Aahz)
>
> From: "Dan Ross" <dan at rosspixelworks.com>
> Date: January 7, 2011 9:12:59 AM CST
> To: "Pythonmac-sig" <pythonmac-sig at python.org>
> Subject: [Pythonmac-SIG] Py2app/Python 3.1 error
> Reply-To: dan at rosspixelworks.com
>
>
> Has anyone seen this before?
>
> Traceback (most recent call last):
> File "setup.py", line 18, in <module>
> setup_requires=['py2app'],
> File
> "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/core.py",
> line 110, in setup
> _setup_distribution = dist = klass(attrs)
> File
> "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/setuptools/dist.py",
>
> line 225, in __init__
> _Distribution.__init__(self,attrs)
> File
> "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/distutils/dist.py",
> line 263, in __init__
> self.finalize_options()
> File
> "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/setuptools/dist.py",
>
> line 258, in finalize_options
> ep.load()(self, ep.name, value)
> File
> "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/pkg_resources.py",
>
> line 1954, in load
> entry = __import__(self.module_name, globals(),globals(),
> ['__name__'])
> File
> "/Users/danr/.local/lib/python3.1/site-packages/py2app/build_app.py",
> line 28, in <module>
> from modulegraph.find_modules import find_modules, parse_mf_results
> File
> "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/find_modules.py",
> line 21, in <module>
> from . import modulegraph
> File
> "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/modulegraph.py",
> line 31, in <module>
> from . import util
> File
> "/Users/danr/.local/lib/python3.1/site-packages/modulegraph/util.py",
> line 69, in <module>
> cookie_re = re.compile(B("coding[:=]\s*([-\w.]+)"))
> 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.
>
> I'm using ActiveState's Python 3.1 if that makes a difference.
>
> Thanks,
>
> Dan
>
>
>
>
>
>
>
> From: Aahz <aahz at pythoncraft.com>
> Date: January 7, 2011 12:03:08 PM CST
> To: Pythonmac-sig <pythonmac-sig at python.org>
> Subject: Re: [Pythonmac-SIG] Py2app/Python 3.1 error
>
>
> 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
>
>
>
> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
More information about the Pythonmac-SIG
mailing list