-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion to support both Python 2.7 and Python 3.5 #5
Conversation
- Run 2to3 on the changed files - Added some from __future__, but not everywhere - new.classobj to type() - Got to first real error
- The ability to run it as an interactive script is preserved
Well, it isn't working as well as I thought. tox error. Adding a travis-ci.org build is helping. Give it a couple of days. |
- Idea is to use mkdocs, more modern
PyZ3950/CQLParser.py
Outdated
@@ -136,7 +136,7 @@ class ModifiableObject: | |||
modifiers = [] | |||
|
|||
def __getitem__(self, k): | |||
if (type(k) == types.IntType): | |||
if (type(k) == int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PEP8: Use isinstance()
PyZ3950/c2query.py
Outdated
@@ -2,11 +2,10 @@ | |||
#!/usr/local/bin/python2.3 | |||
|
|||
try: | |||
from cStringIO import StringIO | |||
from io import StringIO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above.
This code says do X, if that does not work, do X again.
Co-authored-by: Christian Clauss <cclauss@me.com>
Timely, they just got our new Alma Z39.50 server running - I will get back to this. |
#!/usr/local/bin/python2.3 | ||
from io import StringIO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Python 2 io.StringIO
!= StringIO.StringIO
from io import StringIO | |
try: | |
from StringIO import StringIO # Python 2 | |
except ImportError: | |
from io import StringIO # Python 3 |
I am not a maintainer and have no rights to merge pull requests. |
My apologies! 😊 @asl2, are you able to respond? |
My apologies for not responding earlier. I haven't done anything Z3950-related (or indeed library-related) in a while. This is fine as far as it goes, but when I try to run under Python3 I get the following traceback: Traceback (most recent call last): Perhaps I've done something obvious wrong, but my thought was that PyZ3950 relied on Python 2's identity of string and bytes and would need somewhat more work for a port to Python 3. I'll try to free up some time to look at this more closely. |
I saw the commit fixing the tests. Thanks so much for taking care of this! |
Please see #6 for other Py3 changes needed. |
Hi,
I'm hoping this addresses #3 and #4. I'm also hoping you are willing to act as a host to work on this software - I understand you've probably moved on, but if you can tell me how to run the various pieces, we can begin to get it back in working order.
If you look at my github profile, you'll be able to see my interest. I've brought the OCCS/AB branch of the National Library of Medicine to Python, and as we upgrade our ILS, our cataloging/meta-data workflow depends on my getting this or some other well-supported MARC metasearch working with Python 3.