shirah-reader icon indicating copy to clipboard operation
shirah-reader copied to clipboard

crash on entering speed read mode

Open Brutus11111 opened this issue 5 years ago • 11 comments

Installed it today. It crashes when I start the speed read mode.

Traceback (most recent call last):
  File "/home/user/.local/bin/shirah", line 8, in <module>
    sys.exit(main())
  File "/home/user/.local/lib/python3.8/site-packages/shirah_reader/__main__.py", line 2021, in main
    curses.wrapper(preread, file)
  File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "/home/user/.local/lib/python3.8/site-packages/shirah_reader/__main__.py", line 1898, in preread
    incr, width, y, pctg, sec = reader(ebook, idx, width, y, pctg, sec)
  File "/home/user/.local/lib/python3.8/site-packages/shirah_reader/__main__.py", line 1826, in reader
    ALLPREVLETTERS[index] + sum(LOCALPCTG[: y + rows - 1])
TypeError: can only concatenate tuple (not "int") to tuple

Brutus11111 avatar Nov 10 '20 10:11 Brutus11111

fyi, installed it with "pip3 install shirah-reader".

edit: removed it, reinstalled with pip instead of pip3, same issue.

Brutus11111 avatar Nov 10 '20 14:11 Brutus11111

I tried to recreate this issue locally using python 3.8.1, but could not. I suspect it maybe some issue with the file you are trying to read. Does this occur with all files?

Hallicopter avatar Nov 10 '20 18:11 Hallicopter

I tried this specific epub file:

https://www.gutenberg.org/ebooks/28497 (epub, no images)

Same problem with this one:

https://www.gutenberg.org/ebooks/37488 (epub, no images)

They open fine in other epub readers. It's the speed reading that's showing me the error.

Brutus11111 avatar Nov 11 '20 15:11 Brutus11111

Hi there, so I downloaded the first file (Myths of the Norsemen), and am not able to recreate the bug. Could you do the following for me:

  1. In the assests folder of the repo, there is alice.epub (from project gutenberg), and try the speed reading mode.
  2. If that crashes too, I suspect its a python version mismatch, I am running my tests in 3.8.1, which version do you use?

I am just seeing how to recreate this bug locally, so that I can write some patch for it.

Hallicopter avatar Nov 13 '20 11:11 Hallicopter

I couldn't find it on my machine, but I downloaded it from poject gutenburg. Same issue.

I'm using Python 3.8.6

Brutus11111 avatar Nov 17 '20 09:11 Brutus11111

Hi there, so I downloaded the first file (Myths of the Norsemen), and am not able to recreate the bug. Could you do the following for me:

  1. In the assests folder of the repo, there is alice.epub (from project gutenberg), and try the speed reading mode.
  2. If that crashes too, I suspect its a python version mismatch, I am running my tests in 3.8.1, which version do you use?

I am just seeing how to recreate this bug locally, so that I can write some patch for it.

Just a friendly reminder. Have you been able to replicate it? Both my desktop at home and at work have the same issue.

Brutus11111 avatar Dec 04 '20 15:12 Brutus11111

Unfortunately not. I will try and put some time in trying to replicate it again, but I am a little busy nowadays. Will attempt fixing this by the end of the year, with some other upgrades I have in mind.

Hallicopter avatar Dec 05 '20 07:12 Hallicopter

I really appreciate that you shared this repo. It looks cool. It seemed to be working for me, but then it started crashing like mentioned above.

I'd also be curious whether it would be possible to make the font style and size configurable and eliminate the flicker. And make it "remember" where I left off for a certain book.

ryancwalsh avatar Jun 10 '21 14:06 ryancwalsh

It does remember, as long it exits gracefully. You can see once how to exit. Again, didn't really get time to replicate the crash, but if it ever happens to me, will fix. To stop RSVP, hit ctrl+c and to get out of the reader, hit esc. It will remember your position for next time.

Also, the next time, you don't even need to type the full address, you can just type shirah <name-of-book>, it will do a search and open the book with the closest name among the ones you had previously opened.

Hallicopter avatar Jun 30 '21 06:06 Hallicopter

Hi, I also face the same problem. I was able to replicate it, with alice.epub, python version 3.9.6. Setting wpm to 400wpm.

sunnyrahul25 avatar Jul 16 '21 05:07 sunnyrahul25

Issue is with rsvp() function. Addressed in https://github.com/Hallicopter/shirah-reader/pull/13

joshuashaffer avatar Oct 28 '23 22:10 joshuashaffer