[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [GsoC] your latest commit of tasks_udd.py



Hi,

On Thu, Jul 23, 2015 at 5:00 PM, Andreas Tille <andreas@an3as.eu> wrote:
>
> Hi Akshita,
>
> On Thu, Jul 23, 2015 at 04:01:51PM +0530, Akshita Jha wrote:
> >
> > I have almost completed porting tasks_udd.py and blendstasktools_udd.py to
> > Python 3 using 2to3 program. Apart from the obvious changes required in the
> > scripts (which were done by the 2to3 tool mostly):
> >
> > 1)  I had to make some changes to the .xhtml files present in template
> > folder.
>
> OK, seems just a replacement of has_key, right?  Looks sensible.
 
Yes. It was just a replacement of 'has_key' in all the template files.

> > 2) Also, genshi seems to be broken for Python 3.4. The error I was getting :
> >
> > Exception: Unhandled node type <class '_ast.NameConstant'>
> >
> > was known [0] and I fixed it by applying all the patches for this specific
> > error.
>
> Ahh, you were able to fix this in the code?  I understood[0] as if we
> would need a fixed python3-genshi package.  Could you please be a bit
> more verbose about this?  The thing is that we might need to backport
> python2-genshi to Debian 8 to enable running our scripts on the final
> destination.  That's generally no problem but we need to remember this.
>

We indeed need to fix python3-genshi package. There was an error in the line :  print(template.generate(**data).render('xhtml'), file=f) in tasks_udd.py with Traceback to
.
.
.
 raise Exception('Unhandled node type %r' % type(node))
Exception: Unhandled node type <class '_ast.NameConstant'>

Similar errors shown in [0].

To rectify this error:
- I applied the patch [1] to /usr/local/lib/python3.4/dist-packages/genshi/compat.py.
- Applied patch [2] and [3] to the /usr/local/lib/python3.4/dist-packages/genshi/template/astutil.py and /usr/local/lib/python3.4/dist-packages/genshi/template/eval.py files.

Regards,
Akshita

> > [0] http://genshi.edgewall.org/ticket/582
[1] http://genshi.edgewall.org/changeset/1248
[2] http://genshi.edgewall.org/changeset/1249
[3] http://genshi.edgewall.org/changeset/1250



Reply to: