Port to Python 3.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Oct 2019 18:12:28 +0000 (19:12 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 11 Apr 2020 11:44:21 +0000 (12:44 +0100)
commitf76230157bd427829e49628de37d53f9c8ae7842
tree22a2f45ed6319cc8b41db691f34790a4419bcdc5
parent6286102d3187aa7bb36859fe626c85f3220722fd
Port to Python 3.

Most of this is `#ifdef ...' ... `#endif' noise, with a few tweaks
thrown in.

Some notes on specific parts of the port.

  * buffer.c: The Python 3 buffer protocol is completely different.
    Read buffers work differently, but aren't problematic; write buffers
    can now be held open for an extended period, so we need the locking
    machinery that was added recently.

  * catacomb.c: Module initialization has changed, but isn't a great
    deal more difficult.

  * catacomb/__init__.py, catacomb/pwsafe.py, pock, pwsafe: There are a
    number of places which need language-version switches, but none of
    them is especially interesting.  This diff is noisier than it should
    be because I couldn't adjust the indentation in advance.

  * mp.c: With the abolition of a separate fixnum type, `mp_frompylong'
    needed to express the fast path from a fixnum in a different way.

  * pwsafe: The hacking to alter the error-handling behaviour associated
    with the `stdout' stream is deeply unpleasant.  Sorry.

  * pyke/pyke.h: Most of the porting work happens here, with alternative
    definitions for the various macros introduced earlier.

  * .gitignore: Ignore Python 3 `__pycache__/' turds.  Python 3 leaves
    its pre-tokenized files in `__pycache__/' directories, which somehow
    manage to be much more objectionable than the loose Python 2 `*.pyc'
    files.  Ignore these.

  * debian/: Add the necessary things to build a Python 3 extension
    package.
26 files changed:
.gitignore
MANIFEST.in
buffer.c
bytestring.c
catacomb.c
catacomb/__init__.py
catacomb/pwsafe.py
debian/control
debian/python-catacomb.install [new file with mode: 0644]
debian/python3-catacomb.install [new file with mode: 0644]
debian/rules
ec.c
field.c
group.c
mp.c
pgen.c
pock
pwsafe
pyke/mapping.c
pyke/pyke-mLib.c
pyke/pyke.c
pyke/pyke.h
t/t-bytes.py
t/t-convert.py
t/t-mp.py
t/testutils.py