Stop after file not found

4 views
Skip to first unread message

Gerdus van Zyl

unread,
Mar 3, 2008, 7:37:59 AM3/3/08
to Apydia
I get the following error when running Apydia on my code:

------------------------------------------------------------------------
C:\uxpython\src>setup.py apydia
running apydia
Generating API reference documentation.
running apydia
Generating API reference documentation.
2008-03-03 14:28:01,398 DEBUG generating symbol "apydocs\uxGUI.html"
2008-03-03 14:28:02,239 DEBUG creating directory "apydocs\css"
2008-03-03 14:28:02,249 DEBUG copying "c:\uxpython\docs\apydia\apydia
\themes\def
ault\css/default.css" to "apydocs\css/default.css"
2008-03-03 14:28:02,249 DEBUG generating resource "apydocs\css/
pygments.css"
2008-03-03 14:28:02,388 ERROR Failed to extract comments from
<function GetArgv
at 0x0183C3F0>: list index out of range
error: EasyDialogsResources.res: No such file or directory
------------------------------------------------------------------------

It then just stops dead, and does not continue. How do i fix it? a
simple exclusion of the offending modules using:
exclude_modules = uxGUI.platforms.EasyDialogs
does not seem to work.

Thank you.

Daniel Haus

unread,
Mar 3, 2008, 7:50:00 AM3/3/08
to apy...@googlegroups.com
What version do you use, did you try the latest trunk (r45)? There are
many bugfixes in there, so you should try that one first. If that
doesn't work, I'll have a closer look at your problem.

Greetings
Daniel

Gerdus van Zyl

unread,
Mar 3, 2008, 9:07:16 AM3/3/08
to apy...@googlegroups.com
I am using latest from SVN. Revision 45

Gerdus van Zyl

unread,
Mar 3, 2008, 12:46:11 PM3/3/08
to apy...@googlegroups.com
If it would help you can get the code from www.uxpython.com/toolkit.
It's not exactly the same but the code apydia is choking on has not
changed. AFAIK.

Thank you.

Daniel Haus

unread,
Mar 3, 2008, 1:11:17 PM3/3/08
to apy...@googlegroups.com
Am 03.03.2008 um 18:46 schrieb Gerdus van Zyl:

> If it would help you can get the code from www.uxpython.com/toolkit.
> It's not exactly the same but the code apydia is choking on has not
> changed. AFAIK.
>
> Thank you.

Grabbed the uxPython-tarball, tried to set it up, and figured out that
it
doesn't install as easily on my Mac as I hoped - actually pygtk fails,
not uxPython so far.

I need to setup an appropriate virtual Windows environment to test
this and can't promise when I will find the tie to do so.

Alternatively, if you could find out the filename and line number
(inside
Apydia) where it stalls (does ^C work?), we could narrow the problem
down?

Gerdus van Zyl

unread,
Mar 3, 2008, 4:24:16 PM3/3/08
to apy...@googlegroups.com
Mm, don't think uxpython will work on a Mac yet.

I have however found the offending code after digging around:
in ModuleDesc:
-------------------------------------------------------------------
@classmethod
def load(cls, pathname, project):
print "loading",pathname
if pathname not in cls._modules:
print "premp"
try:
__import__(pathname)
except Exception, ex:
print ex,type(ex)
print "loading",pathname,"done"
return create_desc(sys.modules[pathname], project)
else:
print "loading",pathname,"done"
return cls._modules[pathname]
-------------------------------------------------------------------

The exception __import__ is throwing is an IOError. That somehow
causes the program to exit, not hanging/stall. It does seem as if
exclusion of the problem module is not called before trying to import
it?

~Gerdus

Daniel Haus

unread,
Mar 3, 2008, 4:43:49 PM3/3/08
to apy...@googlegroups.com
Am 03.03.2008 um 22:24 schrieb Gerdus van Zyl:

> I have however found the offending code after digging around:
> in ModuleDesc:
> -------------------------------------------------------------------
> @classmethod
> def load(cls, pathname, project):
> print "loading",pathname
> if pathname not in cls._modules:
> print "premp"
> try:
> __import__(pathname)
> except Exception, ex:
> print ex,type(ex)
> print "loading",pathname,"done"
> return create_desc(sys.modules[pathname], project)
> else:
> print "loading",pathname,"done"
> return cls._modules[pathname]
> -------------------------------------------------------------------
>
> The exception __import__ is throwing is an IOError. That somehow
> causes the program to exit, not hanging/stall. It does seem as if
> exclusion of the problem module is not called before trying to import
> it?
>
> ~Gerdus

Great, I'll have a closer look and will come back to you as soon as
possible. Not before wednesday unfortunately, as I won't be here
tomorrow. Thanks for figuring that out, Gerdus.

Daniel Haus

unread,
Mar 6, 2008, 4:42:14 AM3/6/08
to apy...@googlegroups.com
Am 03.03.2008 um 22:24 schrieb Gerdus van Zyl:
> have however found the offending code after digging around:
> in ModuleDesc:
> [...]

> The exception __import__ is throwing is an IOError. That somehow
> causes the program to exit, not hanging/stall. It does seem as if
> exclusion of the problem module is not called before trying to import
> it?

Hi Gerdus!

Could you please update to the latest trunk (r47) and see, if this
changes anything for you?

Thanks & greetings!

--
Daniel Haus
http://ematia.de

Gerdus van Zyl

unread,
Mar 6, 2008, 5:24:18 AM3/6/08
to apy...@googlegroups.com
Ok it now fails with an AttributeError on some other module - pywintypes.error

Normal:
<module 'uxGUI.platforms.platformgtk' from 'C:\uxpython\src\uxGUI\platforms\plat
formgtk.pyc'> <class 'uxGUI.platforms.platformgtk.platformWindow'>
One that gives the error:
None <class 'pywintypes.error'>

see output below:


--------------------------------
C:\uxpython\src>setup.py apydia
running apydia
Generating API reference documentation.
running apydia
Generating API reference documentation.

2008-03-06 12:05:11,164 DEBUG generating symbol "apydocs\base.html"
2008-03-06 12:05:11,164 DEBUG generating symbol "apydocs\base.uBase.html"
2008-03-06 12:05:12,676 DEBUG generating symbol "apydocs\base.uxCalculated.html"

2008-03-06 12:05:12,706 DEBUG generating symbol "apydocs\base.uxEvent.html"
2008-03-06 12:05:13,127 DEBUG generating symbol "apydocs\uxGUI.window.html"
2008-03-06 12:05:13,127 DEBUG generating symbol "apydocs\uxGUI.window.syncoset.h
tml"
<string>:1: (ERROR/3) Document or section may not begin with a transition.
<string>:1: (ERROR/3) Document may not end with a transition.
2008-03-06 12:05:13,576 DEBUG generating symbol "apydocs\uxGUI.window.uxWindow.h
tml"
<string>:1: (ERROR/3) Invalid section title or transition marker.

******************************************************************************
*******************************************************************************
<string>:3: (ERROR/3) Invalid section title or transition marker.

*******************************************************************************
*******************************************************************************
<string>:1: (ERROR/3) Document or section may not begin with a transition.
<string>:1: (ERROR/3) Document may not end with a transition.
<string>:1: (ERROR/3) Invalid section title or transition marker.

******************************************************************************
*******************************************************************************
<string>:3: (ERROR/3) Invalid section title or transition marker.

*******************************************************************************
*******************************************************************************
2008-03-06 12:05:15,079 DEBUG copying "c:\uxpython\docs\apydia\apydia\themes\def


ault\css/default.css" to "apydocs\css/default.css"

2008-03-06 12:05:15,089 DEBUG generating resource "apydocs\css/pygments.css"
2008-03-06 12:05:15,220 ERROR Failed to extract comments from <function GetArgv
at 0x0188A6F0>: list index out of range
Traceback (most recent call last):
File "C:\uxpython\src\setup.py", line 65, in <module>
download_url = "http://www.uxpython.com/toolkit",
File "c:\python25\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "c:\python25\lib\distutils\dist.py", line 974, in run_commands
self.run_command(cmd)
File "c:\python25\lib\distutils\dist.py", line 994, in run_command
cmd_obj.run()
File "c:\uxpython\docs\apydia\apydia\options.py", line 155, in run
self.execute(main, (), msg=message)
File "c:\python25\lib\distutils\cmd.py", line 358, in execute
util.execute(func, args, msg, dry_run=self.dry_run)
File "c:\python25\lib\distutils\util.py", line 347, in execute
apply(func, args)
File "c:\uxpython\docs\apydia\apydia\options.py", line 154, in main
self.option_parser.run_from_distutils(self)
File "c:\uxpython\docs\apydia\apydia\options.py", line 167, in run_from_distut
ils
self.run(options)
File "c:\uxpython\docs\apydia\apydia\command.py", line 96, in run
project = Project(options)
File "c:\uxpython\docs\apydia\apydia\project.py", line 63, in __init__
desc = ModuleDesc.load(module_name, self)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load


return create_desc(sys.modules[pathname], project)

File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc

return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 228, in __init__
self.parent = ModuleDesc.load(".".join(self.pathname.split(".")[:-1]), proje
ct)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load


return create_desc(sys.modules[pathname], project)

File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc

return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 221, in __init__
for name, desc in self.find_submodules():
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 289, in find_submod
ules
m = ModuleDesc.load(prefix + name, self.project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load


return create_desc(sys.modules[pathname], project)

File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc

return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 221, in __init__
for name, desc in self.find_submodules():
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 289, in find_submod
ules
m = ModuleDesc.load(prefix + name, self.project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 234, in load


return create_desc(sys.modules[pathname], project)

File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc

return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 217, in __init__
super(ModuleDesc, self).__init__(module, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 114, in __init__
self._members = self.find_members()
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 261, in find_member
s
desc = create_desc(value, self.project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 424, in create_desc

return class_(value, project)
File "c:\uxpython\docs\apydia\apydia\descriptors.py", line 323, in __init__
self.module = ModuleDesc.load(getmodule(class_).__name__, project)
AttributeError: 'NoneType' object has no attribute '__name__'
----------------------------

Sorry for causing all this trouble :-)

Thanks.

---------

Daniel Haus

unread,
Mar 6, 2008, 5:32:53 AM3/6/08
to apy...@googlegroups.com
No need to be sorry, we're helping each others.

Now this looks much better to me, and the stacktrace really helps a
lot. I'll see what I can find from here...

Daniel Haus

unread,
Mar 6, 2008, 8:10:17 AM3/6/08
to apy...@googlegroups.com
This looks like there's a class with no module. Apydia doesn't know
such a thing, that's why it fails. It might be that I'm wrong and the
"class" it tries to create a descriptor for even isn't a class at all,
but I can't figure that out by reading the stack trace.

Could you figure the class out on which it chokes? This could be
easily done by putting some print statement into the constructor of
"ClassDesc", like so (descriptors.py, lines 318 and following):

def __init__(self, class_, project):
super(ClassDesc, self).__init__(class_, project)
self.name = getattr(class_, "__name__", "")
if not isinstance(self.name, basestring):
self.name = ""
print self.name
self.module = ModuleDesc.load(getmodule(class_).__name__,
project)
self.parent = self.module
self.pathname = ".".join([self.module.pathname, self.name])

Gerdus van Zyl

unread,
Mar 6, 2008, 9:23:26 AM3/6/08
to apy...@googlegroups.com
When I put the following line there:

print class_,self.name,getmodule(class_)

i get the following:

<class 'pywintypes.error'> error None

and output for nonfailing class:

<class 'uxGUI.platforms.platformgtk.platformWindow'> platformWindow <module 'uxG


UI.platforms.platformgtk' from 'C:\uxpython\src\uxGUI\platforms\platformgtk.pyc'
>

FYI, pywintypes is a c extension.

~Gerdus

Daniel Haus

unread,
Mar 6, 2008, 11:33:17 AM3/6/08
to apy...@googlegroups.com
Hmm, did you try to exclude pywintypes in your setup.cfg va the
exclude_modules option?

Gerdus van Zyl

unread,
Mar 6, 2008, 3:06:26 PM3/6/08
to apy...@googlegroups.com
First thing I tried. My setup.cfg looks like this:
[apydia]
title = uxPython
theme = default
modules = uxGUI.base,uxGUI.window
exclude_modules = pywintypes,uxGUI.platforms

Maybe because it can't find the module it can't exclude it? All the
errors I have gotten with apydia has been with code that I did not
create and would happily exclude if I could.

Daniel Haus

unread,
Mar 6, 2008, 3:18:11 PM3/6/08
to apy...@googlegroups.com
Am 06.03.2008 um 21:06 schrieb Gerdus van Zyl:
>
> First thing I tried. My setup.cfg looks like this:
> [apydia]
> title = uxPython
> theme = default
> modules = uxGUI.base,uxGUI.window
> exclude_modules = pywintypes,uxGUI.platforms
>
> Maybe because it can't find the module it can't exclude it? All the
> errors I have gotten with apydia has been with code that I did not
> create and would happily exclude if I could.


Most likely, it needs to find out the package's absolute pathname
before comparing it to the 'exclude'-patterns.

We're one step closer, but this won't work too well 'remotely'. I'll
setup a virtual Windows environment and try to reproduce (and debug)
the errors directly. Testing packages that depend on binary, non-
python modules is on my Apydia-todo-list as well as testing it under
Windows, anyway. So that's a great chance for me to get these things
done.

Thank you for your patience, I'll keep you informed about my progress.

Greetings!

Daniel Haus

unread,
Mar 6, 2008, 6:50:09 PM3/6/08
to apy...@googlegroups.com
Looks like I got it now, please update to r49 and try yourself. The
problem is that 'getmodule(class_)' returns None, but fortunately
'class_.__module__' works, which gets the job done as well.

Am 06.03.2008 um 21:06 schrieb Gerdus van Zyl:
>

Gerdus van Zyl

unread,
Mar 7, 2008, 4:23:48 AM3/7/08
to apy...@googlegroups.com
It works! Apydia now runs throught my entire code with no problem.
Thank you very much.
Reply all
Reply to author
Forward
0 new messages