[Twisted-web] Nevow and python 3

Glyph glyph at twistedmatrix.com
Wed Jan 24 00:51:44 MST 2018


> On Jan 23, 2018, at 2:03 AM, Markus Demleitner <msdemlei at ari.uni-heidelberg.de> wrote:
> 
> Hi,
> 
> Since I have a couple of projects building on nevow that I'd like to
> keep maintaining into the post-python2 world (and at least one of
> them contains a broader user base that I can't easily get to port
> templates and such), I've started porting nevow to python3.  What's
> on https://github.com/msdemlei/nevow runs essentially all the unit
> tests that weren't broken on python2 except for those related to
> livepages.

Hi Markus!

> I've not tried to port any python2 code to this now, though, since I
> find the current situation where lots of byte strings leak
> through from twisted.web quite unsatisfying.  I've tried to formulate
> something like a preliminary policy in
> https://github.com/msdemlei/nevow/blob/master/doc/strings_and_bytes.rst,
> but I'm deeply unhappy about most of this.

Yeah, IRequest is an unfortunate interface.  Work is ongoing to design a more thoughtful one and gradually migrate to it.  I think https://github.com/wsanchez/txrequest <https://github.com/wsanchez/txrequest> is getting pretty complete, and from there the hope is that it will get integrated into Klein and then upstreamed into Twisted.

> Ideally, I'd like to fairly exclusively expose actual strings to

"actual" meaning text?

> nevow client code unless they actually deal with binary data (as in
> static.File, and of course request.write needs to be able to deal
> with this).  This will probably mean isolating client code from
> twisted.web.Requests a bit more.
> 
> So: 
> 
> (1) Is anyone else still interested in this?

I can't speak to anyone else, but the fact that Nevow has a duplicated resource model is kind of unfortunate; that's why we're hoping to just replace the Twisted one eventually.  (But in an upward-compatible way, with comprehensive interoperability and a smooth deprecation transition, not web2 all over again...)

> (2) Is anyone at all interested in the livepages stuff (I'm not, and
> dropping it would certainly make porting and maintaining the package
> a lot easier)?

If you're going to drop livepage, is there any reason you're not just migrating to twisted.web.template?  Is there any way t.w.t could be made into an easier migration path?

> (3) If I went ahead with this and actually tried to get a
> python3-nevow into Debian (which I'd really, really like to see): How
> is everyone's feeling about keeping the name nevow even if serious
> functional changes (such as dropping livepages) were to come about?
> [What I care about most is keeping the templating system including
> the render_ and data_ methods].


If you're going to do a fork, please come up with a new name.  Using the existing one is confusing, it causes namespace conflicts (what happens when Nevow itself gets some upstream patches that port it to python 3 from someone else?) and it causes import conflicts.

That said, if you are interested in porting Nevow the same way that Twisted is being ported (i.e. there's one set of sources, but `pip install` on python 3 only installs the modules ported thus far) then that would certainly be a way to invest the effort in just porting the parts that you need, and letting someone else port LivePage later :).  I'd be happy to make you a maintainer if you're interested in doing this - not a lot of other activity on Nevow right now!

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-web/attachments/20180123/a077aa83/attachment.html>


More information about the Twisted-web mailing list