Skip to content
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

Simple change for python 3 #22

Open
anuvab opened this issue Jan 9, 2017 · 5 comments
Open

Simple change for python 3 #22

anuvab opened this issue Jan 9, 2017 · 5 comments

Comments

@anuvab
Copy link

anuvab commented Jan 9, 2017

I was trying to run this library on python 3, and this line threw a syntax error. It's a simple fix to add brackets to the print statement, and looking through the code, there don't seem to be any other issues that stop python 3 support.

@sergioadonis
Copy link

sergioadonis commented Apr 13, 2017

No compatible with python3 ?

@fchevitarese
Copy link
Contributor

I´ve made a small PR for this.

@abbasovalex
Copy link
Owner

abbasovalex commented Oct 10, 2017

@anuvab @sergioadonis @fchevitarese thank you for your participation. It had been fixed. Does this work fine? Could you please confirm?

@anuvab
Copy link
Author

anuvab commented Oct 11, 2017

There are still some issues.

On this line

elif isinstance(json_obj, (basestring, int, float)):
    name, _, key = name.rpartition(self.separator)
    inputs.append(self._as_text_field(name, key, json_obj))

should be replaced by

import six
elif isinstance(json_obj, (six.string_types[0], int, float)):
    name, _, key = name.rpartition(self.separator)
    inputs.append(self._as_text_field(name, key, json_obj))

That's all I can see for now. But I don't use this on python3 anymore, so this is what I could see just reading the code. There might be more things to change, for proper support.

Created a PR.

@abbasovalex
Copy link
Owner

@anuvab thank you! I need scrutinize investigate and test it. It will take some time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants