Status of PY3 support

127 views
Skip to first unread message

Nicolas Évrard

unread,
Nov 17, 2011, 9:24:02 AM11/17/11
to gen...@googlegroups.com
Hello,

I am porting my library for odt templating to python 3 and genshi is
one of its dependencies.

Now I am wondering what is the current status of python 3 support for
genshi. I saw here:

http://groups.google.com/group/genshi/browse_thread/thread/57f239b1a6f5c202

that the support was ready for inclusion but it seems to have never
happened. What is the status of this ?

--
(°> Nicolas Évrard
( ) Liège

Simon Cross

unread,
Nov 17, 2011, 10:30:50 AM11/17/11
to gen...@googlegroups.com
Hi

On Thu, Nov 17, 2011 at 4:24 PM, Nicolas Évrard <ni...@no-log.org> wrote:
> Now I am wondering what is the current status of python 3 support for
> genshi. I saw here:
>
>
>  http://groups.google.com/group/genshi/browse_thread/thread/57f239b1a6f5c202
>
> that the support was ready for inclusion but it seems to have never
> happened. What is the status of this ?

It was merged into trunk. :)

Genshi trunk supports Python 3 -- if you find any bugs, please report them.

Schiavo
Simon

Arc Riley

unread,
Nov 17, 2011, 1:20:40 PM11/17/11
to gen...@googlegroups.com
Has this been released yet?  Genshi 0.6 is marked in Gentoo's portage tree as Py2-only.


--
You received this message because you are subscribed to the Google Groups "Genshi" group.
To post to this group, send email to gen...@googlegroups.com.
To unsubscribe from this group, send email to genshi+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/genshi?hl=en.


Simon Cross

unread,
Nov 17, 2011, 3:28:16 PM11/17/11
to gen...@googlegroups.com
On Thu, Nov 17, 2011 at 8:20 PM, Arc Riley <arcr...@gmail.com> wrote:
> Has this been released yet?  Genshi 0.6 is marked in Gentoo's portage tree
> as Py2-only.

Genshi 0.6 is Python 2 only. Genshi 0.7 (yet to be released) will be
the first released version to support Python 3.

Schiavo
Simon

Arc Riley

unread,
Nov 17, 2011, 3:35:02 PM11/17/11
to gen...@googlegroups.com
Do we have an ETA on that?  Even a beta release?


Schiavo
Simon

Arc Riley

unread,
Nov 18, 2011, 3:02:30 PM11/18/11
to gen...@googlegroups.com
svn trunk installed on Python 3.2.2 fresh install:

Python 3.2.2 (default, Nov 18 2011, 14:31:30)
[GCC 4.5.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import genshi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "genshi/__init__.py", line 25, in <module>
    from genshi.core import *
  File "genshi/core.py", line 24, in <module>
    from genshi.util import plaintext, stripentities, striptags, stringrepr
  File "genshi/util.py", line 16, in <module>
    import htmlentitydefs as entities
ImportError: No module named htmlentitydefs
>>>

Nicolas Évrard

unread,
Nov 17, 2011, 12:13:06 PM11/17/11
to gen...@googlegroups.com
* Simon Cross [2011-11-17 16:30 +0100]:
>Hi

Hello,

>> Now I am wondering what is the current status of python 3 support for
>> genshi. I saw here:
>>
>>
>>  http://groups.google.com/group/genshi/browse_thread/thread/57f239b1a6f5c202
>>
>> that the support was ready for inclusion but it seems to have never
>> happened. What is the status of this ?
>
>It was merged into trunk. :)

I missed the commit in my search, sorry for the noise.

>Genshi trunk supports Python 3 -- if you find any bugs, please report them.

I will thanks.

Erik Swanson

unread,
Nov 20, 2011, 8:50:08 PM11/20/11
to Genshi
On Nov 18, 12:02 pm, Arc Riley <arcri...@gmail.com> wrote:
> svn trunk installed on Python 3.2.2 fresh install:
..snipped..

> ImportError: No module named htmlentitydefs

I'm assuming you ran 'setup.py develop', like I did before
encountering the exact same problem.
Unfortunately, Genshi only supports Python 3 via 2to3, and 'setup.py
develop' only places a .egg-link file, it doesn't run 2to3 on the
code.
The solution is to use 'setup.py install' instead, which does cause
2to3 to be run.

Simon Cross

unread,
Nov 21, 2011, 4:39:14 PM11/21/11
to gen...@googlegroups.com
On Thu, Nov 17, 2011 at 10:35 PM, Arc Riley <arcr...@gmail.com> wrote:
> Do we have an ETA on that?  Even a beta release?

I've been meaning to cut a release for some time -- I really just need
to set an evening aside and do it. :?

Schiavo
Simon

Simon Cross

unread,
Nov 21, 2011, 4:41:55 PM11/21/11
to gen...@googlegroups.com
On Mon, Nov 21, 2011 at 11:39 PM, Simon Cross <hodg...@gmail.com> wrote:
> I've been meaning to cut a release for some time -- I really just need
> to set an evening aside and do it. :?

I have arbitrarily declared the 28th as Genshi release day.

Arc Riley

unread,
Nov 21, 2011, 5:57:05 PM11/21/11
to gen...@googlegroups.com
Nope.  "python3 setup.py build" - and 2to3 did run as part of that.

Simon Cross

unread,
Nov 21, 2011, 6:00:12 PM11/21/11
to gen...@googlegroups.com
On Tue, Nov 22, 2011 at 12:57 AM, Arc Riley <arcr...@gmail.com> wrote:
> Nope.  "python3 setup.py build" - and 2to3 did run as part of that.

Build places the results of 2to3 in the (depths of the) build folder.
Is that in your PYTHONPATH or similar or are you perhaps attempting to
import the Python 2 version of the code that is in the top of your
checkout?

Schiavo
Simon

Arc Riley

unread,
Nov 21, 2011, 6:08:00 PM11/21/11
to gen...@googlegroups.com
arc@nut ~/work $ svn co http://svn.edgewall.org/repos/genshi/trunk genshi
[...]
Checked out revision 1178.
arc@nut ~/work $ cd genshi
arc@nut ~/work/genshi $ python3
python3    python3.1  python3.2 
arc@nut ~/work/genshi $ python3.2 setup.py build
[...]
copying genshi/template/tests/templates/test_no_doctype.html -> build/li[4/1965]
/template/tests/templates
Fixing build/lib/genshi/input.py build/lib/genshi/compat.py build/lib/genshi/cor
e.py build/lib/genshi/__init__.py build/lib/genshi/util.py build/lib/genshi/outp
ut.py build/lib/genshi/builder.py build/lib/genshi/path.py build/lib/genshi/filt
ers/html.py build/lib/genshi/filters/__init__.py build/lib/genshi/filters/i18n.p
y build/lib/genshi/filters/transform.py build/lib/genshi/template/eval.py build/
lib/genshi/template/plugin.py build/lib/genshi/template/base.py build/lib/genshi
/template/__init__.py build/lib/genshi/template/_ast24.py build/lib/genshi/templ
ate/loader.py build/lib/genshi/template/astutil.py build/lib/genshi/template/tex
t.py build/lib/genshi/template/markup.py build/lib/genshi/template/interpolation
.py build/lib/genshi/template/directives.py build/lib/genshi/template/ast24.py b
uild/lib/genshi/tests/input.py build/lib/genshi/tests/core.py build/lib/genshi/t
ests/__init__.py build/lib/genshi/tests/util.py build/lib/genshi/tests/output.py
 build/lib/genshi/tests/builder.py build/lib/genshi/tests/path.py build/lib/gens
hi/filters/tests/__init__.py build/lib/genshi/filters/tests/i18n.py build/lib/ge
nshi/filters/tests/test_html.py build/lib/genshi/filters/tests/transform.py buil
d/lib/genshi/template/tests/eval.py build/lib/genshi/template/tests/plugin.py bu
ild/lib/genshi/template/tests/base.py build/lib/genshi/template/tests/__init__.p
y build/lib/genshi/template/tests/loader.py build/lib/genshi/template/tests/text
.py build/lib/genshi/template/tests/markup.py build/lib/genshi/template/tests/in
terpolation.py build/lib/genshi/template/tests/directives.py build/lib/genshi/te
mplate/tests/templates/__init__.py
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
Fixing build/lib/genshi/input.py build/lib/genshi/compat.py build/lib/genshi/cor
e.py build/lib/genshi/__init__.py build/lib/genshi/util.py build/lib/genshi/outp
ut.py build/lib/genshi/builder.py build/lib/genshi/path.py build/lib/genshi/filt
ers/html.py build/lib/genshi/filters/__init__.py build/lib/genshi/filters/i18n.p
y build/lib/genshi/filters/transform.py build/lib/genshi/template/eval.py build/
lib/genshi/template/plugin.py build/lib/genshi/template/base.py build/lib/genshi
/template/__init__.py build/lib/genshi/template/_ast24.py build/lib/genshi/templ
ate/loader.py build/lib/genshi/template/astutil.py build/lib/genshi/template/tex
t.py build/lib/genshi/template/markup.py build/lib/genshi/template/interpolation
.py build/lib/genshi/template/directives.py build/lib/genshi/template/ast24.py b
uild/lib/genshi/tests/input.py build/lib/genshi/tests/core.py build/lib/genshi/t
ests/__init__.py build/lib/genshi/tests/util.py build/lib/genshi/tests/output.py
 build/lib/genshi/tests/builder.py build/lib/genshi/tests/path.py build/lib/gens
hi/filters/tests/__init__.py build/lib/genshi/filters/tests/i18n.py build/lib/ge
nshi/filters/tests/test_html.py build/lib/genshi/filters/tests/transform.py buil
d/lib/genshi/template/tests/eval.py build/lib/genshi/template/tests/plugin.py bu
ild/lib/genshi/template/tests/base.py build/lib/genshi/template/tests/__init__.p
y build/lib/genshi/template/tests/loader.py build/lib/genshi/template/tests/text
.py build/lib/genshi/template/tests/markup.py build/lib/genshi/template/tests/in
terpolation.py build/lib/genshi/template/tests/directives.py build/lib/genshi/te
mplate/tests/templates/__init__.py
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
arc@nut ~/work/genshi $ sudo python3.2 setup.py install                        
[...]
Finished processing dependencies for Genshi==0.7dev-r1177
arc@nut ~/work/genshi $ python3.2

Python 3.2.2 (default, Nov 18 2011, 14:31:30)
[GCC 4.5.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import genshi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "genshi/__init__.py", line 25, in <module>
    from genshi.core import *
  File "genshi/core.py", line 24, in <module>
    from genshi.util import plaintext, stripentities, striptags, stringrepr
  File "genshi/util.py", line 16, in <module>
    import htmlentitydefs as entities
ImportError: No module named htmlentitydefs
>>>


Stefano Rivera

unread,
Nov 22, 2011, 2:04:48 AM11/22/11
to gen...@googlegroups.com
Hi Arc (2011.11.22_01:08:00_+0200)

> arc@nut ~/work/genshi $ python3.2
> Python 3.2.2 (default, Nov 18 2011, 14:31:30)
> [GCC 4.5.1] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import genshi
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "genshi/__init__.py", line 25, in <module>
> from genshi.core import *

chdir out of there. It's importing the untranslated genshi, because the
current directory comes first in sys.path.

SR

--
Stefano Rivera
http://tumbleweed.org.za/
H: +27 21 465 6908 C: +27 72 419 8559 UCT: x3127

Arc Riley

unread,
Nov 22, 2011, 8:08:25 AM11/22/11
to gen...@googlegroups.com
Ah-ha.  Makes sense.  Thanks.

Reply all
Reply to author
Forward
0 new messages