wustho / epy

CLI Ebook (epub2, epub3, fb2, mobi) Reader
GNU General Public License v3.0
962 stars 52 forks source link

When resizing the terminal window, epy crashed #58

Open mcepl opened 2 years ago

mcepl commented 2 years ago

WIth this backtrace:

stitny~/b/i/h/python-numpy.SUSE_SLE-15_Update ()$ epy /home/matej/Knihy/fanfiction/elsewhere_at_hogwarts/What\'s\ Her\ Name\ in\ Hufflepuff-ao3_22283053.epub
Traceback (most recent call last):
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 1498, in update_library
    metadata = ebook.get_meta()
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 601, in get_meta
    content_opf = ET.parse(self.file.open(self.root_filepath))
  File "/usr/lib64/python3.8/zipfile.py", line 1535, in open
    raise BadZipFile("Bad magic number for file header")
zipfile.BadZipFile: Bad magic number for file header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/matej/.bin/epy", line 33, in <module>
    sys.exit(load_entry_point('epy-reader', 'console_scripts', 'epy')())
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 3982, in main
    filepath = curses.wrapper(preread, filepath)
  File "/usr/lib64/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 3881, in preread
    reading_state_or_ebook = reader.read(reading_state)
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 3729, in read
    self.savestate(
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 2974, in savestate
    self.state.update_library(self.ebook, self.reading_progress)
  File "/home/matej/archiv/knihovna/repos/epy/epy.py", line 1509, in update_library
    conn.close()
UnboundLocalError: local variable 'conn' referenced before assignment                                                                                                                            
mcepl commented 2 years ago

Hmm, and now I cannot reproduce it.