Package: onionshare
Version: 2.2-3
Severity: important
Tags: patch upstream
X-Debbugs-Cc: boy...@riseup.net

Dear Maintainer,

   * What led up to the situation?

In Tails 5.0, onionshare 2.2-3 is installed, Python2 is not.
>From Nautilus, I want to right-click a file and share it via OnionShare.

   * What was the outcome of this action?

Nothing happens. See 
https://gitlab.tails.boum.org/tails/tails/-/issues/18990 for details.

The reason is that onionshare is using urllib.url2pathname. This has 
been renamed to urllib.request.url2pathname in python3.
Here is a fix that keeps compatibility with python2: 
https://github.com/boyska/onionshare/commit/fd6269a7f3e54389543fd3559c8e4d39dfe02b09
I'm also attaching a patch that *drops* compatibility with python2. 
Choose the one you like the most :)

--- /usr/share/nautilus-python/extensions/onionshare-nautilus.py	2019-10-13 18:35:40.000000000 +0000
+++ /usr/share/nautilus-python/extensions/onionshare-nautilus.py	2022-05-26 08:35:15.744000000 +0000
@@ -3,7 +3,7 @@
 import json
 import locale
 import subprocess
-import urllib
+import urllib.request
 import gi
 
 gi.require_version("Nautilus", "3.0")
@@ -67,7 +67,7 @@
     def url2path(self, url):
         file_uri = url.get_activation_uri()
         arg_uri = file_uri[7:]
-        path = urllib.url2pathname(arg_uri)
+        path = urllib.request.url2pathname(arg_uri)
         return path
 
     def exec_onionshare(self, filenames):

Reply via email to