rr- / pq-cli

Progress Quest: the CLI edition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fail on Win10 in --curses, after start Play

PetrGasparik opened this issue · comments

speed = (pos_now - pos_then) / (time_now - time_then).total_seconds()

File "...\pqcli\ui\curses\widgets\progress_bar.py", line 28, in time_left
speed = (pos_now - pos_then) / (time_now - time_then).total_seconds()
ZeroDivisionError: float division by zero

more stacktrace:

File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\views\create_character_view\choose_character_stats_view.py", line 58, in keypress
self.on_confirm(self.stats)
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\event_handler.py", line 10, in call
callback(*args, **kwargs)
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses_init
.py", line 146, in
player_name, race, class_, stats
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses_init_.py", line 189, in _create_character
self.switch_to_game_view(player)
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses_init
.py", line 175, in _switch_to_game_view
self.switch_view(view)
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses_init
.py", line 180, in _switch_view
self.view.start()
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\views\game_view_init
.py", line 162, in start
x=0,
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\views\game_view\character_sheet_window.py", line 32, in init
self.sync()
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\views\game_view\character_sheet_window.py", line 43, in sync
self._sync_exp()
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\views\game_view\character_sheet_window.py", line 66, in _sync_exp
self._render_progress_bar()
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\views\game_view\progress_bar_window.py", line 75, in _render_progress_bar
self._progress_bar.set_position(self._cur_pos, self._max_pos)
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\widgets\progress_bar.py", line 44, in set_position
if self.time_left and self._show_time:
File "C:\Users\pegas\AppData\Roaming\Python\Python37\site-packages\pqcli\ui\curses\widgets\progress_bar.py", line 28, in time_left
speed = (pos_now - pos_then) / (time_now - time_then).total_seconds()
ZeroDivisionError: float division by zero

Fixed on master.

I see, I prepared exactly the same PR just now :))

thank you, @rr-