[Pythonmac-SIG] unicode problem w/pyapp 2.5 vs 2.6
tom wible
airdrummer at wheel.org
Sat Feb 21 13:44:12 CET 2009
i've recently installed 2.6 on my minimac pvr, and it raised a unicode issue:
under 2.5, the filename returned from an applescript.app is plain text:
tomsdvr:/DVR/recordings dvr$ /usr/local/bin/python2.5
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import aem
>>> playrec = aem.Application(aem.findapp.byname('playRec'))
>>> recIndx=22
>>> [sfn, title, eptitle, descr, startDT, stopDT] = playrec.event('ascrpsbr',
{'snam':'getiteminfo', '----': [recIndx]}).send()
>>> sfn
u'New York Goes To War_Jan_17_2009__08_00_26-1_AM.m2t'
>>>
>>> startDT
'Saturday, January 17, 2009 8:00:00 AM'
but under 2.6:
tomsdvr:/DVR/recordings dvr$ python
Python 2.6.1 (r261:67515, Dec 6 2008, 16:42:21)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import aem
>>> playrec = aem.Application(aem.findapp.byname('playRec'))
>>> [sfn, title, eptitle, descr, startDT, stopDT] = playrec.event('ascrpsbr',
{'snam':'getiteminfo', '----': [recIndx]}).send()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'recIndx' is not defined
>>> recIndx=31
>>> [sfn, title, eptitle, descr, startDT, stopDT] = playrec.event('ascrpsbr',
{'snam':'getiteminfo', '----': [recIndx]}).send()
>>> sfn
u'\u4e00\u6500\u7700\u2000\u5900\u6f00\u7200\u6b00\u2000\u4700\u6f00\u6500\u7300\u2000\u5400\u6f00\u2000\u5700\u6100\u7200\u5f00\u4a00\u6100\u6e00\u5f00\u3100\u3700\u5f00\u3200\u3000\u3000\u3900\u5f00\u5f00\u3000\u3800\u5f00\u3000\u3000\u5f00\u3200\u3600\u2d00\u3100\u5f00\u4100\u4d00\u2e00\u6d00\u3200\u7400'
>>> startDT
'Saturday, January 17, 2009 8:00:00 AM'
i had simply copied aem from the 2.5 site-packages to the 2.6's...is there
something i missed in doing that? some data is ok (the dates)
More information about the Pythonmac-SIG
mailing list