Re: [Pythonmac-SIG] unicode problem w/pyapp 2.5 vs 2.6

2009-02-21 Thread has

tom wible wrote:

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:

[...]
>>> sfn
u'New York Goes To War_Jan_17_2009__08_00_26-1_AM.m2t'
[...]
but under 2.6:
[...]
 >>> 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'
[...]
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)


There's a known issue in Python 2.6's Unicode APIs; py-appscript  
0.19.0+ contains a workaround for this.


BTW, Python modules/extensions are not officially binary compatible  
across major Python releases, so you should be installing afresh anyway.


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] 64-bit mode no work

2009-02-21 Thread Ned Deily
In article ,
 Lars Clausen  wrote:
> I've been trying to get mod_python and mysql to work on my Intel  
> MacBook Leopard, but with very little luck. [...]

What about the MySQL library itself, i.e. libmysqlclient?  Do you have a 
64-bit version of it?  The standard distribution from MySQL is not 
4-way, (and, for 5.1.30 at least, it's broken for 2-way: 
).

> Any ideas also why there is no 64-bit installation of Python for Mac?   
> Given the presence of fat binaries, it seems like it would be a  
> trivial task to have it.

The support for 4-way universal builds in python is relatively new.  
There has been some discussion recently on the python-dev list about 
providing "official" 4-way installers for OS X.  This will probably get 
discussed more at the upcoming PyCon.

-- 
 Ned Deily,
 n...@acm.org

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] 64-bit mode no work

2009-02-21 Thread Lars Clausen
I've been trying to get mod_python and mysql to work on my Intel  
MacBook Leopard, but with very little luck. Disliking the idea of  
turning my MySQL and Apache into 32-bit (seems backwards), I have  
installed 64-bit versions of everything:


Hedwig:~ larsrc$ file `which python`
/usr/bin/python: Mach-O 64-bit executable x86_64
Hedwig:~ larsrc$ file /usr/libexec/apache2/mod_python.so
/usr/libexec/apache2/mod_python.so: Mach-O 64-bit bundle x86_64
Hedwig:~ larsrc$ file /Library/WebServer/.python-eggs/ 
MySQL_python-1.2.2-py2.6-macosx-10.5-universal.egg-tmp/_mysql.so
/Library/WebServer/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5- 
universal.egg-tmp/_mysql.so: Mach-O universal binary with 4  
architectures
/Library/WebServer/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5- 
universal.egg-tmp/_mysql.so (for architecture i386):	Mach-O bundle i386
/Library/WebServer/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5- 
universal.egg-tmp/_mysql.so (for architecture ppc):	Mach-O bundle ppc
/Library/WebServer/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5- 
universal.egg-tmp/_mysql.so (for architecture ppc64):	Mach-O 64-bit  
bundle ppc64
/Library/WebServer/.python-eggs/MySQL_python-1.2.2-py2.6-macosx-10.5- 
universal.egg-tmp/_mysql.so (for architecture x86_64):	Mach-O 64-bit  
bundle x86_64

Hedwig:~ larsrc$ file `which httpd`
/usr/sbin/httpd: Mach-O 64-bit executable x86_64

Even so, when I try to load a .py page with mysqldb (using Publisher  
-- the real reason I want Python!), I get the infamous


File "/Library/WebServer/Documents/Python/test.py", line 4, in  
 import MySQLdb
File "build/bdist.macosx-10.5-universal/egg/MySQLdb/__init__.py", line  
19, in 
File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 7, in  

File "build/bdist.macosx-10.5-universal/egg/_mysql.py", line 6, in  
__bootstrap__

ImportError: dynamic module does not define init function (init_mysql)

I have been perusing a number of related pages (in order to get things  
to compile in the first place) that mostly seem to see this as a  
problem of 32/64-bit incompatibility, but with the entire stack being  
64-bit, surely it's something else. Any ideas?


Any ideas also why there is no 64-bit installation of Python for Mac?   
Given the presence of fat binaries, it seems like it would be a  
trivial task to have it.


As an aside, I got so fed up with trying to fix this that I switched  
briefly to IntelliJ + Java to implement my webservices. By the time I  
had gone through the tutorial to set up a sample web service, I had 6  
xml files in play but not a working web service. Publisher is just  
exemplary in its simplicity.


Thanks in advance,
-Lars

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] unicode problem w/pyapp 2.5 vs 2.6

2009-02-21 Thread Nicholas Riley
On Sat, Feb 21, 2009 at 07:44:12AM -0500, tom wible wrote:
> 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)

Looks like you might have a UCS-4 version of one Python and a UCS-2
version of the other.  Extension modules are not compatible between
the two, although usually you get a link error.

It's probably easiest just to reinstall install appscript on 2.6.

-- 
Nicholas Riley  | 
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] unicode problem w/pyapp 2.5 vs 2.6

2009-02-21 Thread tom wible

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 "", line 1, in 
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)

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig