OSError: readline() not supported on Gio.File objects when cropping
steps to reproduce:
- scan a page, anything will do, with text or without
- select the page
- click the edit button
- click the crop (scissors) button
- validate
Observed behavior: A traceback is shown in a popup:
Traceback (most recent call last):
File "/nix/store/h8h5l71gd2pal7xiaf7bi07i1074sz8z-python3.11-openpaperwork-core-2.2.2/lib/python3.11/site-packages/openpaperwork_core/promise.py", line 235, in _threaded_do
our_r = self.func(*args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/h8h5l71gd2pal7xiaf7bi07i1074sz8z-python3.11-openpaperwork-core-2.2.2/lib/python3.11/site-packages/openpaperwork_core/pillow/img.py", line 64, in url_to_img_size
img = PIL.Image.open(fd)
^^^^^^^^^^^^^^^^^^
File "/nix/store/5hdbk36nvb097g71cd57k3hcx8d51xm8-python3.11-pillow-10.2.0/lib/python3.11/site-packages/PIL/Image.py", line 3293, in open
im = _open_core(
^^^^^^^^^^^
File "/nix/store/5hdbk36nvb097g71cd57k3hcx8d51xm8-python3.11-pillow-10.2.0/lib/python3.11/site-packages/PIL/Image.py", line 3274, in _open_core
im = factory(fp, filename)
^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/5hdbk36nvb097g71cd57k3hcx8d51xm8-python3.11-pillow-10.2.0/lib/python3.11/site-packages/PIL/ImageFile.py", line 137, in __init__
self._open()
File "/nix/store/5hdbk36nvb097g71cd57k3hcx8d51xm8-python3.11-pillow-10.2.0/lib/python3.11/site-packages/PIL/ImImagePlugin.py", line 151, in _open
s = s + self.fp.readline()
^^^^^^^^^^^^^^^^^^
File "/nix/store/6aih3jdilynvxcqfw4g3mwc88icgksxc-python3.11-openpaperwork-gtk-2.2.2/lib/python3.11/site-packages/openpaperwork_gtk/fs/gio.py", line 99, in readline
raise OSError("readline() not supported on Gio.File objects")
OSError: readline() not supported on Gio.File objects
Expected behavior: no error
Note that if I dismiss the error popup everything seems fine.
I could not use the automatic bug report submission system because of a 504 error so here is the zip bug.zip
paperwork 2.2.2 x86_64-linux Nixos 23.11
Edited by symphorien