Closed chrismattmann closed 9 years ago
A workaround on this is to download and install Python 2.7.8. I was able to get Tika working using 2.7.8. After installing, I pip install --upgrade --force tika. This should install Tika 1.9.3. After doing so, double check to make sure there aren't any temporary instances of tika server that are corrupt from previous downloads using HTTPS where it messed up because of 2.7.9. The way I checked was checking:
c:\users\chrisa~1\appdata\local\temp\
which is where tika-server is downloaded to. Check the jar file it may likely be corrupt. Delete it if necessary (which will cause Python to redownload it for you).
Then, try e.g., parser.from_file again:
>>> parser.from_file('C:\Users\Chris A Mattmann\Desktop\BalanceSheet.pdf')
tika.py: Retrieving http://search.maven.org/remotecontent?filepath=org/apache/tika/tika-server/1.9/tika-server-1.9.jar to c:\users\chrisa~1\appdata\local\temp\tika-server.jar.
{'content': None, 'metadata': {u'access_permission:can_modify': [u'true'], u'access_permission:extract_content': [u'true'], u'access_permission:assemble_document': [u'true'], u'access_permission:extract_for_accessibility': [u'true'], u'access_permission:fill_in_form': [u'true'], u'pdf:encrypted': [u'false'], u'access_permission:can_print': [u'true'], u'dc:format': [u'application/pdf; version=1.3'], u'access_permission:can_print_degraded': [u'true'], u'access_permission:modify_annotations': [u'true'], u'pdf:PDFVersion': [u'1.3'], u'X-TIKA:parse_time_millis': [u'886'], u'xmpTPg:NPages': [u'0'], u'resourceName': [u'BalanceSheet.pdf'], u'Content-Type': [u'application/pdf'], u'X-Parsed-By': [[u'org.apache.tika.parser.DefaultParser', u'org.apache.tika.parser.pdf.PDFParser']]}}
>>>
Works fine. Will keep trying to find a more permanent fix than install Python 2.7.8.
OK confirmed that I can monkey patch this in the latest version. I am going to add a check inside of the function where it downloads the tika jar checking for an IOError, and if so, then doing:
>>> import ssl
>>> if hasattr(ssl, '_create_unverified_context'):
ssl._create_default_https_context = ssl._create_unverified_context
Running on latest Python 2.7.9 on windows Vista and I get this:
I've tried monkey patching as suggested in:
http://stackoverflow.com/questions/27835619/ssl-certificate-verify-failed-error
Still get same error.
And also read:
http://bugs.python.org/issue23052