adb014 / nsf2x

A Lotus Notes NSF to EML, MBOX and PST converter
GNU General Public License v2.0
83 stars 25 forks source link

Exception in Tkinter callback #3

Closed wwender closed 7 years ago

wwender commented 7 years ago

First thanks for providing nsf2x 👍

I use nsf2x in the latest version(1.3.2) in a complete 32bit setup. I have an issue with one database containing about 100k Messages. After about 25k Messages I get the following exception:

Exception in Tkinter callback Traceback (most recent call last): File "nsf2x.py", line 894, in realConvert File "", line 2, in GetMIMEEntity File "C:\Logiciel\WinPython-32bit-3.4.4.4Qt5\python-3.4.4\lib\site-packages\win32com\client\dynamic.py", line 287, in ApplyTypes pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, 'NotesDocument', 'Notes error: Invalid or missing RFC822 header name.', None, 0, -2147217504), None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Logiciel\WinPython-32bit-3.4.4.4Qt5\python-3.4.4\lib\tkinter__init.py", line 1538, in call__ File "nsf2x.py", line 591, in doConvert File "nsf2x.py", line 655, in doConvertDirectory File "nsf2x.py", line 972, in realConvert TypeError: unlink: can't specify None for path argument

adb014 commented 7 years ago

For the missing RFC822 error there is not much I can do as the message itself seems to be corrupted. However, the RFC822 error shouldn't make NSF2X quit the conversion, rather than jsut skip the corrupt message. The trivial fix is to replace

try:
    os.remove(eml)
except OSError:
    pass

around line 972 with

try:
    os.remove(eml)
except (OSError, TypeError):
    pass

At the time of the first exception the path to the eml file doexn't exist. I'll make a 1.3.3 release soon and put it on the site

adb014 commented 7 years ago

Ok I fixed it slightly differently than the above so as not to enlarge too much the exceptions that are skipped, and have uploaded a v1.3.3. Give me feedback if the problem is fixed and I'll close this issue

David

wwender commented 7 years ago

Thanks. I will test it. Wim

wwender commented 7 years ago

It works (documents with exceptions are skipped)!

adb014 commented 7 years ago

Ok, so closing this bug