Edgewall Software

Opened 9 years ago

Last modified 17 months ago

#10083 closed enhancement

Make Trac work with Python 3 — at Version 12

Reported by: Remy Blank Owned by:
Priority: normal Milestone:
Component: general Version:
Severity: normal Keywords: python3
Cc: leho@…, Thijs Triemstra, gabriele.svelto@…, Ryan J Ollos, py.hieroglyph@…, Jun Omae, Arthur.Solomon@…, t17-0by@… Branch:
Release Notes:
API Changes:

Description (last modified by Christian Boos)

With Genshi having been ported to Python 3, we could start thinking about how we can achieve the same with Trac. As a first step, we should check if our dependencies have a Python 3 port:

Database backends

SQLite builtin sqlite3, PySqlite?
PostgreSQL psycopg 2.4
MySQL unofficial mysqldb or pymysql

Version control bindings

Subversion unlikely (1)
Mercurial unlikely (2)

Web frontends

Apache mod_wsgi

Others

setuptools (Distribute) works (3)
Genshi py3k branch
Babel #bl209
pytz works (2011d)
docutils works (4)
pygments works (1.4)

Notes

  • svn: not much activity on the bindings; rather go the svn.exe way
  • hg: after 2 GSoC projects already, the efforts seem to have stalled
  • distribute: seems ok on Linux, "works" more or less on Windows; might be worth to wait for distutils2
  • docutils: seems it was ported and works on Linux, but easy_install docutils on Windows hangs… Installing docutils-0.7.tar.gz also hangs, so it seems it's not distribute's fault.

Once we have at least one backend, VC binding and frontend ready, the next step would be playing with 2to3 and see what comes out. See also resources listed in PortingPythonToPy3k.

Let's set the milestone tentatively to 0.14.

Change History (12)

comment:1 by Eli Carter, 9 years ago

There is also a 3to2 tool, and rumors here at PyCon that 3to2 will (soonish?) have the ability to take Python 3 code and output versions that will work for 2.7, 2.6, 2.5, and maybe even 2.4.

comment:2 by lkraav <leho@…>, 9 years ago

Cc: leho@… added

in reply to:  1 comment:3 by Christian Boos, 9 years ago

Replying to ecarter:

There is also a 3to2 tool, and rumors here at PyCon that 3to2 will (soonish?) have the ability to take Python 3 code and output versions that will work for 2.7, 2.6, 2.5, and maybe even 2.4.

For projects that need to be migrating away from Python 3? ;-)

comment:4 by Thijs Triemstra, 9 years ago

Cc: Thijs Triemstra added

comment:5 by Christian Boos, 9 years ago

Description: modified (diff)

Create a table for the packages and document some already py3k compatible packages or in-progress status.

comment:6 by Christian Boos, 9 years ago

Description: modified (diff)

Correction: Simon Cross' py3k branch not yet on trunk apparently.

comment:7 by Remy Blank, 9 years ago

Description: modified (diff)

Added some data according to what's installed on my machine (Gentoo Linux).

comment:8 by Christian Boos, 9 years ago

Description: modified (diff)

Report my early experiments with distribute on Python 3.2 (x64) on Windows 7.

comment:9 by Christian Boos, 9 years ago

Description: modified (diff)

Add some infos on db related packages. Nothing actually tested, though.

comment:10 by osimons, 9 years ago

I think 3k support is a valid target for Trac 0.14, but as a note of warning I think the target should be to get 0.14 to run internally (passing tests) but NOT make it an announced and supported configuration until later.

There is hardly anyone running Trac without plugins, and getting 3k support in 0.14 helps establish the fixes, best-practices and compat code needed to help plugin developers get converted too.

If we push this out too soon admins will just end up being disappointed and end up reverting to 2.x just to get their configuration working. It is really a no-win situation to make this officially supported too soon.

comment:11 by Felix Schwarz, 9 years ago

I'd like to add that pytz has an official Python 3 package (see tracking bug where I attached my patches).

For Babel Python 3 support is actually my no 1 item to release 1.0.

in reply to:  11 comment:12 by Christian Boos, 9 years ago

Description: modified (diff)

Replying to fschwarz:

I'd like to add that pytz has an official Python 3 package

Ok, that was actually what got easy_install'ed when I tried. Thanks for the additional details!

Note: See TracTickets for help on using tickets.