adrienverge / PhotoCollage

Graphical tool to make photo collage posters
GNU General Public License v2.0
432 stars 73 forks source link

Drag & Drop broken on Fedora 39/40 #109

Closed swesemeyer closed 4 months ago

swesemeyer commented 4 months ago

When dragging and dropping images onto the main window nothing happens....

Running Photocollage from the command line shows the following error:

/usr/lib/python3.12/site-packages/photocollage/artwork.py:21: PyGIWarning: GdkPixbuf was imported without specifying a version first. Use gi.require_version('GdkPixbuf', '2.0') before import to ensure that the right version gets loaded.
  from gi.repository import GdkPixbuf

Traceback (most recent call last):

  File "/usr/lib/python3.12/site-packages/photocollage/gtkgui.py", line 307, in on_drag
    files[i] = urllib.parse.unquote(files[i][7:])

              ^^^^^^^^^^^^

AttributeError: module 'urllib' has no attribute 'parse'

The fix is to import urllib.parse in line 24 of gtkgui.py instead of just urllib.

adrienverge commented 4 months ago

Hello, thanks for the report!

I just tested with Fedora 40 and Python 3.12.3, I cannot reproduce the bug (dragging and dropping an image from Nautilus to PhotoCollage works as expected, as well as dragging and dropping images from within PhotoCollage (swapping them)).

However I can reproduce in a Python console:

>>> import urllib
>>> urllib.parse.unquote('file://test')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'urllib' has no attribute 'parse'
>>> import urllib.parse
>>> urllib.parse.unquote('file://test')
'file://test'

I fixed this in https://github.com/adrienverge/PhotoCollage/pull/112.