Conversation
tested pdf file reading with password-encrypted files
…ting to output stream.
… is 3 or greater only.
|
Marvelous! We'll be in touch. Many thanks. |
|
I like your work very much. We definitely want to integrate it. |
|
There's no rush. I'll continue testing and tweaking the code meanwhile. |
|
Hi kushal-kumaran, I have one issue that maybe you can resolve (I might have done something wrong). I cloned your changes and am testing them for compatibility with Python 2.7 and 3.2. It works fine on 2.7, but after I run the setup.py script on 3.2, I am unable to use PyPDF2. Here's the output (I tried importing just one class and the whole library to no avail): I don't really have experience with Python 3, so I may be at fault here. To install I just ran |
|
On Sat, Jul 21, 2012 at 12:01:21PM -0700, knowah wrote:
|
|
@knowah is it possible you ran setup.py with python2 instead of python3? When running under python3, setup.py invokes 2to3, which would have changed the import statement in from pdf import PdfFileReader, PdfFileWriterto this: from .pdf import PdfFileReader, PdfFileWriterThe leading dot in The conversion to absolute imports is one of the conversions done by 2to3. So, there can be one of three problems:
|
|
@knowah After running into exactly the same issue myself yesterday, just make sure you are not running python from the directory with the PyPDF2 source. During the build process, 2to3 runs and converts the sources, but the converted files go to the build directory, and the original files are left alone. If you run python from the same directory, it will attempt to look at the PyPDF2 package in the current directory, getting the wrong versions of the files. |
Hi,
I have changes to make a single source tree work to build both python 2 and python 3 (using 2to3) packages. There are also changes to fix a couple of issues:
I've tested these changes with a script that writes out decrypted version of some encrypted pdf files using both python2 and python3. If you guys are interested, you can test it out with your collection.