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

Make codebase python3 compatible; #56

Closed
wants to merge 7 commits into from

Conversation

kingtaurus
Copy link
Contributor

Currently the arxiv-sanity-preserver is not python3 compatible. This pull request does the following:

(1) reworks imports for urllib and pickle;
(2) convert to print_function (from __future__ import print_function);
(3) switch from iteritems() and iterkeys() in favor of items() and keys();
(4) starting to wrap functionality of various scripts into functions to remove dependencies on magic value (currently reworked download_pdfs.py - to allow for specifying the timeout, database file and output directory);

With these changes I believe this should allow python3 to be used to run the code (note: pickling will have to be reworked - if you want to use python3 after running in python2).

(1) added print_function;
(2) reworked urllib and pickle imports;
(1) added print_function;
(2) reworked pickle import;
(3) removed superfluous import of urllib;
(1) added print_function;
(2) reworked pickle import;
(3) reworked urllib import;
(4) added download_pdf function to remove magic values;
(1) added print_function;
(2) replaced xrange with range (less ideal for python2, better for python3);
(1) added print_function;
(2) replaced xrange with range (less ideal for python2, better for python3);
(3) replaced iteritems with items (less ideal for python2, better for python3);
(1) added print_function;
(2) replaced iteritems with items (less ideal for python2, better for python3);
(1) added print_function;
(2) replaced xrange with range (less ideal for python2, better for python3);
(3) replaced iteritems with items, similarly with keys; (less ideal for python2, better for python3);
@karpathy
Copy link
Owner

karpathy commented Jan 14, 2017

Oh no! I was in the process of converting the code base to python3, halfway through it. My progress is in py3 branch, planning to finish up over this weekend or so.

Also my plan is to nuke py2 support altogether. meh.

@kingtaurus
Copy link
Contributor Author

No Problem. I just ran 2to3 on it and then add a few modifications to allow for simple python2 compatibility.

@kingtaurus
Copy link
Contributor Author

Look's like you've updated this yourself. I'll close the pull request.

@kingtaurus kingtaurus closed this Feb 7, 2017
@karpathy
Copy link
Owner

karpathy commented Feb 8, 2017

Correct, thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants