Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_curses.error: chgat() returned ERR when searching for a specific string #109

Open
jasonblewis opened this issue Aug 6, 2024 · 0 comments

Comments

@jasonblewis
Copy link

Hi,

In a certain ebook, when I search for the word "abuse" it causes epy to crash. Searching for other strings does not cause it to crash.

Traceback (most recent call last):
  File "/home/jason/.local/bin/epy", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/jason/.local/pipx/venvs/epy-reader/lib/python3.11/site-packages/epy_reader/__main__.py", line 18, in main
    filepath = curses.wrapper(reader.start_reading, filepath)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jason/.local/pipx/venvs/epy-reader/lib/python3.11/site-packages/epy_reader/reader.py", line 1600, in start_reading
    reading_state_or_ebook = reader.read(reading_state)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jason/.local/pipx/venvs/epy-reader/lib/python3.11/site-packages/epy_reader/reader.py", line 877, in read
    board.write(reading_state.row)
  File "/home/jason/.local/pipx/venvs/epy-reader/lib/python3.11/site-packages/epy_reader/board.py", line 109, in write
    self.render_styles(row, self.default_style, bottom_padding)
  File "/home/jason/.local/pipx/venvs/epy-reader/lib/python3.11/site-packages/epy_reader/board.py", line 53, in render_styles
    self.chgat(row, i.row, i.col, i.n_letters, self.screen.getbkgd() | i.attr)
  File "/home/jason/.local/pipx/venvs/epy-reader/lib/python3.11/site-packages/epy_reader/board.py", line 77, in chgat
    self.screen.chgat(y - row, self.x + x, n, attr)
_curses.error: chgat() returned ERR
epubcheck test.epub 
Validating using EPUB version 3.2 rules.
No errors or warnings detected.
Messages: 0 fatals / 0 errors / 0 warnings / 0 infos

pipx upgrade epy-reader 
epy-reader is already at latest version 2023.6.11 (location: /home/jason/.local/pipx/venvs/epy-reader)

I also tested on a different epub and I did not get the same crash.

I can supply the epub for testing purposes if need be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant