-
Notifications
You must be signed in to change notification settings - Fork 245
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
Need to update to python3 #84
Comments
Hi there, It's not just the print statement that was removed in favor of a print function (this one can be handled easily by means of the Tools/2to3.py script), far more impacting is that with python 3 binary data (bytes, bytearray) cannot be treated interchangeably as string. Most of the file content handling in the scripts is based on strings while the file is read in binary mode ('rb') as Python 2.x did not enforce such strictures. A naïve approach for the conversion to Python 3 might be to replace all literal strings with binary representations e.g. ('...' -> b'...'), however then still need to fix up the places that use string functions such as ord() or unescapeString(), etc... What I did: I attached the files in case someone wants to have a look at them e.g. compare/diff. |
@jbremer 's fork of peepdf and others work on Python3 thanks to commits from @Evert0x and others. I got "ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting" trying to install it with Somewhere in the many branches of the 123 forks of this project is one that will work, but it's definitely not this one and it's hard to find 🤕 . |
That's correct. What about it though? Perhaps would be good to include this information in the README. Personally I only use peepdf in the context of Cuckoo Sandbox and in that case those setup steps are documented in the Cuckoo documentation hehe. Feel free to PR on our fork. |
I had to use python2 because was impossible to make it work with python3. |
Branch from enzok/peepdf is working just fine, works with python 3.9 (tested on 29.9.2021) |
There are a number of places that need to be updated for this to work with python3. In particular the print statements. All prints need to be updated to conform to python3 standards. Currently all prints are of the form
print 'stuff'
, this does not work for python3. Convert all of the print toprint('stuff')
.The text was updated successfully, but these errors were encountered: