PythonConfluenceAPI icon indicating copy to clipboard operation
PythonConfluenceAPI copied to clipboard

Python 3 Compatibility

Open rpcope1 opened this issue 10 years ago • 3 comments

I have no idea if this works well (if at all) with Python 3, as I have only verified it against Python 2.6, 2.7. I (or someone else) should build and run this on a Python 3 instance, or make the changes necessary to ensure Python 3 future compatibility.

rpcope1 avatar Sep 02 '15 15:09 rpcope1

I've started on this path, going to put a few notes here.

  1. setup.py needs a change to the author variable, as python3 won't be able to string format. Make it a single string instead of 2 cojoined strings.

__author__ = 'Robert Cope, Pushrod Technology'

  1. After that change, setup.py does build and install an egg. But importing it fails with not finding the api.

At this point, I'm a bit stumped. I'll look around though. I'm hoping to use this library with errbot.io which is python3 only.

>>> from PythonConfluenceAPI import ConfluenceAPI
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/hogenj/projects/PythonConfluenceAPI/PythonConfluenceAPI/__init__.py", line 3, in <module>
    from api import ConfluenceAPI, all_of
ImportError: No module named 'api'

ytjohn avatar Mar 05 '16 17:03 ytjohn

I'll see if I can't figure it out. I've never checked Python 3 compatibility with this library, but I'd agree that's a rather important thing to have, and I'd like to help you make use of it.

On Sat, Mar 5, 2016 at 10:26 AM, John Hogenmiller [email protected] wrote:

I've started on this path, going to put a few notes here.

  1. setup.py needs a change to the author variable, as python3 won't be able to string format. Make it a single string instead of 2 cojoined strings.

author = 'Robert Cope, Pushrod Technology'

  1. After that change, setup.py does build and install an egg. But importing it fails with not finding the api.

At this point, I'm a bit stumped. I'll look around though. I'm hoping to use this library with errbot.io which is python3 only.

from PythonConfluenceAPI import ConfluenceAPI Traceback (most recent call last): File "", line 1, in File "/Users/hogenj/projects/PythonConfluenceAPI/PythonConfluenceAPI/init.py", line 3, in from api import ConfluenceAPI, all_of ImportError: No module named 'api'

— Reply to this email directly or view it on GitHub https://github.com/pushrodtechnology/PythonConfluenceAPI/issues/8#issuecomment-192693084 .

rpcope1 avatar Mar 05 '16 18:03 rpcope1

PR generated. All minor changes. I added some future imports that weren't absolutely necessary, but will help us keep the code python3 compatible.

ytjohn avatar Mar 05 '16 19:03 ytjohn