-
Notifications
You must be signed in to change notification settings - Fork 60
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
Python 3 compatibility #19
base: master
Are you sure you want to change the base?
Conversation
Thank you very much for help it is cool. |
@xambroz I can give you commit rights to my repository so you can continue there and your commits appear here. What do you think? |
Thank you - that would work. I will add what I have. Currently I have patches which make it work on plain office file. The only thing which I know is not working yet is the extraction of macroes, but I hope to fix that as well. |
In the meanwhile - this is what I have to add at this point: I know that --export-macros is not working in python3.
Even including "from io import StringIO" is not directly fixing the situation:
The original (cStringIO.StringIO) gives this:
|
for python2 alias range to xrange
This fixes annoying bug/feature that the script crashes when no file attribute is provided
…python3 binarray to ascii/hexdump This fixes issue with --print-header and --print-directory
I am investigating the macros extraction. The very first question I need an answer for is whether PROJECT stream in a document should be handled as bytes or Unicode. Because now it's mixed and that's the reason why it does not work in Python 3. Do I understand it correctly that it contains some code in VB script so it should be handled as Unicode? |
Hello,
|
Hello. Unfortunately, I don't have the capacity to work on this anymore. Could we please merge this PR to make the officeparser at least partially Python 3 compatible so others can continue without repeating the same work? |
Hello.
I am trying o make this tool Python 3 compatible while keeping backward compatibility with Python 2.7. I've tested my work with three scenarios and one testing Word document. I am not a user of this tool so I just compared the output for Python 2 and 3 and it seems to be okay.
Tested commands:
If you find something missing, please provide a reproducer (shell command) so I can use it to test my work and backward compatibility.
Fixes: #18