> NameError: global name 'WindowsError' is not defined > in > ERROR: test_FieldEnumeration (__main__.Test_PyLuceneWithFSStore)
I've downloaded current version pylucene-6.2.0-src.tar.gz 2016-09-18 09:04 30M and was able to build JCC and PyLucene on MacOS X10.11 (64-bit, Python 2.7.10 , Java 1.8.0) 'make test' runs without any issues. From the stacktrace and the error: NameError: global name 'WindowsError' is not defined I assume that one test fails to cleanup the store directory and then runs in the undefined 'WindowsError' in test_Python.py def tearDown(self): if os.path.exists(self.STORE_DIR): try: shutil.rmtree(self.STORE_DIR) except WindowsError: # maybe leaking file handles in closing stores # does not affect other tests pass Please look for a directory named 'testrepo‘ , then check it's file permissions and remove it (maybe you did ran the tests as root initially?) - finally run the test again. Of course the error should be catched better on Linux... You could file a bug report here: https://issues.apache.org/jira/browse/PYLUCENE <https://issues.apache.org/jira/browse/PYLUCENE> Note that 'WindowsError' is only available on Windows platform. > for me. I'm using: > python 2.7.12 (I have also tried python 3.5.2 but I have problems to > compile gcc) Note that PyLucene currently lacks official Python3 support! We've done a port of PyLucene 3.6 (!) to support Python3 and offered the patches needed to JCC and PyLucene for use/review on the list - but didn't get any feedback so far. cf. https://www.mail-archive.com/pylucene-dev@lucene.apache.org/msg02167.html <https://www.mail-archive.com/pylucene-dev@lucene.apache.org/msg02167.html> Regards, Thomas -- > Am 03.01.2017 um 16:01 schrieb marco turchi <marco.tur...@gmail.com > <mailto:marco.tur...@gmail.com>>: > > Dear Andi, > following you suggestions, I have first installed pyLucene on a machine > with access to the Web and than I have copied the tree on the cluster > machine where I have installed pyLucene. > > Running the make test I have the following errors: > ERROR: testThroughLayerException (__main__.PythonExceptionTestCase) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "test/test_PythonException.py", line 34, in testThroughLayerException > qp.parse("foo bar") > JavaError: <super: <class 'JavaError'>, <JavaError object>> > Java stacktrace: > java.lang.RuntimeException: TestException > at > org.apache.pylucene.queryparser.classic.PythonQueryParser.getFieldQuery_quoted(Native > Method) > at > org.apache.pylucene.queryparser.classic.PythonQueryParser.getFieldQuery(Unknown > Source > at > org.apache.lucene.queryparser.classic.QueryParser.MultiTerm(QueryParser.java:585) > at > org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:198) > at > org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:187) > at > org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:111) > > and: > NameError: global name 'WindowsError' is not defined > in > ERROR: test_FieldEnumeration (__main__.Test_PyLuceneWithFSStore) > ERROR: test_removeDocuments (__main__.Test_PyLuceneWithFSStore) > ERROR: test_searchDocuments (__main__.Test_PyLuceneWithFSStore) > ... > > > I have checked on the mailing list but I have not found solutions that work > for me. I'm using: > python 2.7.12 (I have also tried python 3.5.2 but I have problems to > compile jcc) > java jdk1.8.0_60 > > do you have an idea of what it is not working? > > Thanks a lot in advance for your help! > Marco