You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by marco turchi <ma...@gmail.com> on 2019/01/27 09:31:20 UTC

Errors when running "make test"

Dear All,
I'm installing PyLucene in a Linux machine. The make command reached the
end without problems but I got this error when running make test:

ERROR: test_removeDocument (__main__.Test_PyLuceneWithFSStore)
ERROR: test_removeDocuments (__main__.Test_PyLuceneWithFSStore)
ERROR: test_searchDocuments (__main__.Test_PyLuceneWithFSStore)
ERROR: test_searchDocumentsWithMultiField
(__main__.Test_PyLuceneWithFSStore)
ERROR: test_FieldEnumeration (__main__.Test_PyLuceneWithMMapStore)
ERROR: test_getFieldInfos (__main__.Test_PyLuceneWithMMapStore)
ERROR: test_indexDocument (__main__.Test_PyLuceneWithMMapStore)
ERROR: test_indexDocumentWithText (__main__.Test_PyLuceneWithMMapStore)
ERROR: test_indexDocumentWithUnicodeText
(__main__.Test_PyLuceneWithMMapStore)
ERROR: test_removeDocument (__main__.Test_PyLuceneWithMMapStore)
ERROR: test_removeDocuments (__main__.Test_PyLuceneWithMMapStore)
ERROR: test_searchDocuments (__main__.Test_PyLuceneWithMMapStore)
ERROR: test_searchDocumentsWithMultiField
(__main__.Test_PyLuceneWithMMapStore)

Expanding one of these items I have this:
ERROR: test_FieldEnumeration (__main__.Test_PyLuceneWithMMapStore)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test3/test_PyLucene.py", line 316, in tearDown
    shutil.rmtree(self.STORE_DIR)
  File "/hltsrv0/turchi/anaconda3/lib/python3.6/shutil.py", line 480, in
rmtree
    _rmtree_safe_fd(fd, path, onerror)
  File "/hltsrv0/turchi/anaconda3/lib/python3.6/shutil.py", line 438, in
_rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
  File "/hltsrv0/turchi/anaconda3/lib/python3.6/shutil.py", line 436, in
_rmtree_safe_fd
    os.unlink(name, dir_fd=topfd)
OSError: [Errno 16] Device or resource busy: '.nfs0000000142c4953f000000cf'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test3/test_PyLucene.py", line 320, in tearDown
    if e.__name__ == 'WindowsError':
AttributeError: 'OSError' object has no attribute '__name__'

For the installation, I'm using python 3.6.5 and the operating system
is Scientific
Centos Fedora 7.5 (Nitrogen)

Thanks a lot!
Marco

Re: Errors when running "make test"

Posted by marco turchi <ma...@gmail.com>.
Yes it fixes the problem.

Thanks a lot!
Marco

On Sun, Jan 27, 2019 at 11:07 PM Andi Vajda <va...@apache.org> wrote:

>
>
> On Sun, 27 Jan 2019, marco turchi wrote:
>
> > Dear Andi,
> > thanks a lot! I will have a look at the configuration of the drivers.
> >
> >
> >> This code needs to be fixed for Python 3.
> >> How is the name of an exception class extracted in Python 3 ?
> >> The exception class cannot be used directly since WindowsError exists
> only
> >> on Windows, making the code using the exception class unportable.
> >>
> >>
>
> Oh, it looks like this code is just missing 'type()', it should say:
>    if type(e).__name__ == 'WindowsError'
>
> Andi..
>
> > According to your question, I guess the generic exception class that
> > includes all the built-in exceptions is BaseException. See here for
> > more details:
> > https://docs.python.org/3/library/exceptions.html#bltin-exceptions
> >
> > Thanks a lot!
> > Marco
> >
>

Re: Errors when running "make test"

Posted by Andi Vajda <va...@apache.org>.

On Sun, 27 Jan 2019, marco turchi wrote:

> Dear Andi,
> thanks a lot! I will have a look at the configuration of the drivers.
>
>
>> This code needs to be fixed for Python 3.
>> How is the name of an exception class extracted in Python 3 ?
>> The exception class cannot be used directly since WindowsError exists only
>> on Windows, making the code using the exception class unportable.
>>
>>

Oh, it looks like this code is just missing 'type()', it should say:
   if type(e).__name__ == 'WindowsError'

Andi..

> According to your question, I guess the generic exception class that
> includes all the built-in exceptions is BaseException. See here for
> more details:
> https://docs.python.org/3/library/exceptions.html#bltin-exceptions
>
> Thanks a lot!
> Marco
>

Re: Errors when running "make test"

Posted by marco turchi <ma...@gmail.com>.
Dear Andi,
thanks a lot! I will have a look at the configuration of the drivers.


> This code needs to be fixed for Python 3.
> How is the name of an exception class extracted in Python 3 ?
> The exception class cannot be used directly since WindowsError exists only
> on Windows, making the code using the exception class unportable.
>
>
According to your question, I guess the generic exception class that
includes all the built-in exceptions is BaseException. See here for
more details:
https://docs.python.org/3/library/exceptions.html#bltin-exceptions

Thanks a lot!
Marco

Re: Errors when running "make test"

Posted by Andi Vajda <va...@apache.org>.
On Sun, 27 Jan 2019, marco turchi wrote:

> Dear All,
> I'm installing PyLucene in a Linux machine. The make command reached the
> end without problems but I got this error when running make test:
>
> ERROR: test_removeDocument (__main__.Test_PyLuceneWithFSStore)
> ERROR: test_removeDocuments (__main__.Test_PyLuceneWithFSStore)
> ERROR: test_searchDocuments (__main__.Test_PyLuceneWithFSStore)
> ERROR: test_searchDocumentsWithMultiField
> (__main__.Test_PyLuceneWithFSStore)
> ERROR: test_FieldEnumeration (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_getFieldInfos (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_indexDocument (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_indexDocumentWithText (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_indexDocumentWithUnicodeText
> (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_removeDocument (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_removeDocuments (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_searchDocuments (__main__.Test_PyLuceneWithMMapStore)
> ERROR: test_searchDocumentsWithMultiField
> (__main__.Test_PyLuceneWithMMapStore)
>
> Expanding one of these items I have this:
> ERROR: test_FieldEnumeration (__main__.Test_PyLuceneWithMMapStore)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File "test3/test_PyLucene.py", line 316, in tearDown
>    shutil.rmtree(self.STORE_DIR)
>  File "/hltsrv0/turchi/anaconda3/lib/python3.6/shutil.py", line 480, in
> rmtree
>    _rmtree_safe_fd(fd, path, onerror)
>  File "/hltsrv0/turchi/anaconda3/lib/python3.6/shutil.py", line 438, in
> _rmtree_safe_fd
>    onerror(os.unlink, fullname, sys.exc_info())
>  File "/hltsrv0/turchi/anaconda3/lib/python3.6/shutil.py", line 436, in
> _rmtree_safe_fd
>    os.unlink(name, dir_fd=topfd)
> OSError: [Errno 16] Device or resource busy: '.nfs0000000142c4953f000000cf'

It looks like you're running off of an NFS drive. All bets are off.
Lucene, in general, doesn't recommend this kind of setup.

> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>  File "test3/test_PyLucene.py", line 320, in tearDown
>    if e.__name__ == 'WindowsError':
> AttributeError: 'OSError' object has no attribute '__name__'

This code needs to be fixed for Python 3.
How is the name of an exception class extracted in Python 3 ?
The exception class cannot be used directly since WindowsError exists only
on Windows, making the code using the exception class unportable.

Andi..

> For the installation, I'm using python 3.6.5 and the operating system
> is Scientific
> Centos Fedora 7.5 (Nitrogen)
>
> Thanks a lot!
> Marco
>