I'm trying ti use PyCrust with a module called SQLObject. my problem
is that the instrospector is getting stuk. the trouble begins with
sqlobject.const which leads the
py.introspection.getAttributeNames into the constructor of a class
called sqlobject.sqlbuilder.SQLOp where it terminates with an error of
attempt to iterate over a nonsequence.
The problem occures at line 71 of py.introspection.py
the local variable attributes seems to have gotten set to an instance
of the SQLOp
class.
This leads to several questions
1) Has anyone else used SQLObject with PyCrust?
2) Dose PyCrust have problems with other modules (i'm new to PyCrust)
or is this a rare event?
3) Should I file a bug report?
I'm trying ti use PyCrust with a module called SQLObject. my problem
is that the instrospector is getting stuk. the trouble begins with
sqlobject.const which leads the
py.introspection.getAttributeNames into the constructor of a class
called sqlobject.sqlbuilder.SQLOp where it terminates with an error of
attempt to iterate over a nonsequence.
The problem occures at line 71 of py.introspection.py
the local variable attributes seems to have gotten set to an instance
of the SQLOp
class.
This leads to several questions
1) Has anyone else used SQLObject with PyCrust?
2) Dose PyCrust have problems with other modules (i'm new to PyCrust)
or is this a rare event?
There was something similar that was fixed a few years ago, so yes it's possible that if modules do tricky things that PyCrust can get confused, but it is relatively rare.
3) Should I file a bug report?
Yes, but a patch fixing the problem would be even better!
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I'd love to generate a patch.
however the question is what is the best solution
1) The easy option. If getAttributeNames throws an error (as appears
here) assume
we have an opaque object and return an empty list. this is an easy
to create patch
and solves the imidiate problem, but seems a little inadequate.
2) Otherwise how to diagnose a problem like this. I writtent a sciprt
with applies the
relvent method directly to the relvent object and tried stepping
through it with a
debugger but so Far I havn't been able to work out what is going wrong. is
there any other tools I could thow at this in an attempt to work
out what is going on.
I just found an article on how to get an execution trace? are
there any tools which
allready do this. The problem seems to be to work out which
function call is setting
the loval attributes variable to an Object Instance (instead of a list).
3) The 3rd option is to say that the problem is not with the
instrospector but with the
SQLObjeject module. the __getattr__ definition in question is
doing a few things
which are a little stange 1) if the attribute name begins with
'__' it raises an attribute
error. Otherwise it returns a new object (passing the attribute
name to the object
constructor). Note that point of SQL object is to hide database
access so it is doing
a lot of dynamic wrapping of attibutes and property creation etc,
as well as some
manipulation of the class hiarchy so it is not entierly easy.
···
On 4/27/06, Robin Dunn <robin@alldunn.com> wrote:
konrad Zielinski wrote:
> HI,
>
> I'm trying ti use PyCrust with a module called SQLObject. my problem
> is that the instrospector is getting stuk. the trouble begins with
> sqlobject.const which leads the
> py.introspection.getAttributeNames into the constructor of a class
> called sqlobject.sqlbuilder.SQLOp where it terminates with an error of
> attempt to iterate over a nonsequence.
>
> The problem occures at line 71 of py.introspection.py
> the local variable attributes seems to have gotten set to an instance
> of the SQLOp
> class.
>
> This leads to several questions
>
> 1) Has anyone else used SQLObject with PyCrust?
> 2) Dose PyCrust have problems with other modules (i'm new to PyCrust)
> or is this a rare event?
There was something similar that was fixed a few years ago, so yes it's
possible that if modules do tricky things that PyCrust can get confused,
but it is relatively rare.
> 3) Should I file a bug report?
Yes, but a patch fixing the problem would be even better!
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
I'd love to generate a patch.
however the question is what is the best solution
It's been a long time since I looked at that code, so I may not be the best person to ask about that.
1) The easy option. If getAttributeNames throws an error (as appears
here) assume
we have an opaque object and return an empty list. this is an easy
to create patch
and solves the imidiate problem, but seems a little inadequate.
Agreed. This should probably be done anyway even if a solution is found for this particular problem, because there will likely be another one someday. However there should be some indication of the problem so the user is made aware that the object may have attributes that are not accessible.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Just to finish off the thread
I worked out what the problem is, and will be submitting
a patch which fixes it (rather than ignores it).
regards
Konrad.
···
On 4/28/06, Robin Dunn <robin@alldunn.com> wrote:
konrad Zielinski wrote:
> I'd love to generate a patch.
> however the question is what is the best solution
It's been a long time since I looked at that code, so I may not be the
best person to ask about that.
>
> 1) The easy option. If getAttributeNames throws an error (as appears
> here) assume
> we have an opaque object and return an empty list. this is an easy
> to create patch
> and solves the imidiate problem, but seems a little inadequate.
Agreed. This should probably be done anyway even if a solution is found
for this particular problem, because there will likely be another one
someday. However there should be some indication of the problem so the
user is made aware that the object may have attributes that are not
accessible.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org