Add compatibility with Python 3.x.

Review Request #9741 — Created March 5, 2018 and submitted — Latest diff uploaded

Information

beanbag-docutils
master
16619d3...

Reviewers

This adds compatibility for building docs on both Python 2.7 and 3.x
releases. For the most part, we were in good shape to support both, but
we had a few things we were doing wrong.

The primary issue was that we were explicitly using bytestrings for
configuration items and signal connections for Sphinx. This used to be a
requirement, but it isn't anymore (except for add_crossref_type(),
which needs native strings). We now use Unicode strings everywhere.

In a few places, we were calling legacy iter* functions on dictionaries.
Those have been updated to use six.iter* instead.

The GitHub support was working with byte data coming from a process's
output, which needed to be decoded to a Unicode string.

There was also a legacy import (sphinx.util.compat.Directive), which we
needed to update.

Sphinx 1.7.1 and six are now requirements for the package, ensuring
we have what we need to build, and classifiers were added advertising
the Python version support.

Built a few doc packages using Python 2.7, 3.4, 3.5, and 3.6.

There may still be some lines of code that weren't tested thoroughly,
but the main use cases worked. Also verified that Python 3.x could
import all the modules without errors.

    Loading...