I think my python-COM environment is messed up.
D:\> python list-fc.py ../Scratch/blank_canvec.gdb <COMObject <unknown>>
and expectedsomething like this:
../Scratch/blank_canvec.gdb\ [u'counties.shp', u'roads.shp']\ counties.shp\ roads.shp
- using Mark Cederholm's python+arcobjects recipe requires registering com stuff, which conflicts wth PythonWin's com stuff.
- I'm using Arcgis with python 2.6 instead of the shipped 2.5. This hasn't proved problematic before, but maybe I just haven't wondered into this section of the forest before (which means I need to eat crow for Jason Scheirer).
- I have concurrent python 2.5 and python 2.6 installs, 32 and 64bit, and they are walking over each other
- one of the many other programs which distribute static python dll's is in path and colliding
- I'm just very poor snake charmer. :)
Win32 bug#3076741, "This object does not support enumeration". Using win32com.client.gencache registers com objects on the fly, fixes one problem and creates others.
update, 2011 Jan 25
I think I've narrowed it to the win32 extension, as presented by the arcgisscriptingwrapper.
I uninstalled all versions of python and cleared all directories from PATH that had any kind of python??.dll, then installed python 2.5.4, and numpy from the arcgis dvd (as per instructions here). If PYTHONPATH contains ...\ArcGIS\bin, then we get the expected results, if not, and we add arcgisscripting.py to Lib\site-packages: win32com not found. If we then install the win32com package we get the \<COMObject \<unknown>> error.
The readme for PythonWin on the install dvd says "ArcGIS no longer installs PythonWin because the recommended methodology for creating the geoprocessor has changed to using a new Python module that ESRI has developed ...".
Sooooo, arcgisscripting.py and win32com work for most things, but not for gp.ListFields() or gp.ListFeatureClasses() functions. I bet this also applies to other list functions too, see changes in list methods knowledgebase article. This means that python 2.6 and 2.7 can be used with ArcGIS 9.x, but only if you stay away from the list functions.