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

Added compatibility for Python3 #30

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

malvidin
Copy link

All changes were made in a way to maintain backward compatibility, but I could not get the absolute imports to work with Python2.
All tests also pass, but a large number of input files was not available for thorough testing.

Convert print to print()
Use string and binary types from six
Converted to absolute imports, somehow breaking Python2
All tests pass
At least one file works (no thorough test suite for sample files)
Better use of tempfile to create files/dirs
Use str.format() for Shapes text
Check for Python 3 location with subprocess for LibreOffice
Move to argparse from deprecated optparse
Use ensure_text and ensure_str from six for compatibility
Added other fixes for Python2/3 string/byte issues
Use Counter to simplify entropy calculations
Use txbxContent variables to track tag open/close
Use find instead of index while walking through XML
@kirk-sayre-work
Copy link
Owner

I'll check this out. Shifting the whole project over to Python 3 would be great. Personally if it got to the point of being solid and stable in Python 3 I would be fine with dropping Python 2 support.

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.

2 participants