retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.89k stars 196 forks source link

ReTexT crashes when switching from preview back to edit #574

Closed raffaem closed 2 years ago

raffaem commented 2 years ago

When I switch from edit to preview all is fine.

When I switch from preview back to edit, ReText crashes.

Here is the console output:

$ retext README.mkd
Using configuration file: /home/raffaele/.config/ReText project/ReText.conf
Traceback (most recent call last):
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/syncscroll.py", line 68, in _handlePreviewResized
    self._updatePreviewScrollPosition()
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/syncscroll.py", line 137, in _updatePreviewScrollPosition
    pos.setY(preview_scroll_offset)
TypeError: setY(self, int): argument 1 has unexpected type 'float'
Traceback (most recent call last):
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/preview.py", line 121, in _handleEditorResized
    self.syncscroll.handleEditorResized(rect.height())
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/syncscroll.py", line 45, in handleEditorResized
    self._updatePreviewScrollPosition()
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/syncscroll.py", line 137, in _updatePreviewScrollPosition
    pos.setY(preview_scroll_offset)
TypeError: setY(self, int): argument 1 has unexpected type 'float'
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib64/python3.10/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib64/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/converterprocess.py", line 72, in _converter_process_func
    job = receiveObject(conn_child)
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/converterprocess.py", line 41, in receiveObject
    sizeBuf = recvall(sock, 4)
  File "/home/raffaele/.local/lib/python3.10/site-packages/ReText/converterprocess.py", line 34, in recvall
    raise EOFError('Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?')
EOFError: Received 0 bytes from socket while more bytes were expected. Did the sender process exit unexpectedly?
Aborted (core dumped)
raffaem commented 2 years ago

Removing the configuration file with:

rm "/home/raffaele/.config/ReText project/ReText.conf"

have fixed it, but I had lost my work due to the crash!!!!!!!

raffaem commented 2 years ago

The crash happens when I enable the WebKit renderer

mitya57 commented 2 years ago

I am sorry for this crash. It's a duplicate of #573, which I received and fixed last week. I will make a new 7.2.3 release ASAP.

raffaem commented 2 years ago

Yeah it's fixed in retext-7.2 branch. I had problems in switching to Python 3.10 too. Thanks!

raffaem commented 2 years ago

Just curious: what's the master branch for?

mitya57 commented 2 years ago

It's for the next major release, 7.3 or 8.0. This issue does not affect master because Qt WebKit support was removed there. See 84600d0b1923fe9b for an explanation.

raffaem commented 2 years ago

Thanks :)

What is the alternative? WebEngine? How do I make ReText use WebEngine?

mitya57 commented 2 years ago

Yes, the alternative is WebEngine.

First, make sure it's installed (apt install python3-pyqt5.qtwebengine or pip install PyQtWebEngine).

Second, replace useWebKit=true with useWebEngine=true in the configuration file.

mitya57 commented 2 years ago

The new release is done now.