BasioMeusPuga / Lector

Qt based ebook reader
GNU General Public License v3.0
1.51k stars 207 forks source link

TypeError: 'NoneType' object is not iterable #29

Closed jnor closed 6 years ago

jnor commented 6 years ago

On arch I get the following errors after installing through AUR:

$ lector                                                                                                                                                   
Locale: en_DK (No translations found)
Database returned no paths for settings...
Available parsers: *.pdf *.epub *.mobi *.azw *.azw3 *.azw4 *.prc *.cbz *.cbr
Database returned nothing
Traceback (most recent call last):
  File "/usr/bin/lector", line 11, in <module>
    load_entry_point('lector==0.3.0', 'gui_scripts', 'lector')()
  File "/usr/lib/python3.6/site-packages/lector/__main__.py", line 1260, in main
    form = MainUI()
  File "/usr/lib/python3.6/site-packages/lector/__main__.py", line 226, in __init__
    self.lib_ref.generate_library_tags()
  File "/usr/lib/python3.6/site-packages/lector/library.py", line 259, in generate_library_tags
    i[0]: (None, None) for i in db_library_directories}
TypeError: 'NoneType' object is not iterable
BasioMeusPuga commented 6 years ago

Mea culpa. This should be working now. Just reinstall from the AUR.

slartibart70 commented 6 years ago

Hi, just installed in fedora27 (with the necessary dependencies) when i came to the same error as above. I did a git update, ran setup again... but: still the same problem

Locale: en_US (No translations found) Database returned no paths for settings... Available parsers: .pdf .epub .mobi .azw .azw3 .azw4 .prc .cbz *.cbr Database returned nothing Traceback (most recent call last): File "/usr/local/bin/lector", line 11, in load_entry_point('lector==0.3.0', 'gui_scripts', 'lector')() File "/usr/local/lib/python3.6/site-packages/lector/main.py", line 1260, in main form = MainUI() File "/usr/local/lib/python3.6/site-packages/lector/main.py", line 226, in init self.lib_ref.generate_library_tags() File "/usr/local/lib/python3.6/site-packages/lector/library.py", line 259, in generate_library_tags i[0]: (None, None) for i in db_library_directories} TypeError: 'NoneType' object is not iterable

BasioMeusPuga commented 6 years ago

@slartibart70 I'm not sure you got the fix I just pushed. That line should be at 261 now.

slartibart70 commented 6 years ago

how can i clean/uninstall this thing? (for a new try)

BasioMeusPuga commented 6 years ago

I assume you used the python setup.py commands in the readme.

If you cloned the repo, type git pull in the root of your local copy. If you downloaded it as a zip, you'll need to download it again. After that it's the same procedure.

slartibart70 commented 6 years ago

well, ok, did that already. And yes, must have been me ... now it doesn't show this error again. Therefore, another one when trying to open an ebup (i removed spaces in folder and filenames, still the same)

`Attempting to open: /scratch/xx.epub Exception in thread Thread-28: multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/usr/lib64/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "/usr/lib64/python3.6/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "/usr/local/lib/python3.6/site-packages/lector/sorter.py", line 212, in read_book all_content = book_ref.get_contents() File "/usr/local/lib/python3.6/site-packages/lector/parsers/epub.py", line 63, in get_contents self.book_ref.parse_chapters(temp_dir=self.extract_path) File "/usr/local/lib/python3.6/site-packages/lector/ePub/read_epub.py", line 246, in parse_chapters chapter_data, self.book['split_chapters'][i]) File "/usr/local/lib/python3.6/site-packages/lector/ePub/read_epub.py", line 317, in get_split_content xml_string = this_split[1] IndexError: list index out of range """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/lib64/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib64/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.6/site-packages/lector/sorter.py", line 270, in pool_creator self.read_book, self.file_list) File "/usr/lib64/python3.6/multiprocessing/pool.py", line 266, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "/usr/lib64/python3.6/multiprocessing/pool.py", line 644, in get raise self._value IndexError: list index out of range `

BasioMeusPuga commented 6 years ago

That's a book specific bug. If you don't mind, could you please link me to that epub? It helps to be able to see why things are happening.

slartibart70 commented 6 years ago

i tried some other ebpubs and azw3 files. Sorry to say, but the "list index out of range" occurrs multiple times (with different epubs) and the whole app crashes after some time browsing pages in the (working and correctly displayed) ebooks. Pdf seems to work fine, though...

BasioMeusPuga commented 6 years ago

@slartibart70 I have fixed a similar bug. If that doesn't solve what you're experiencing, please open a new issue. Preferably with more information.