Nemo version 4.0.x + requires extensions to be Python3 compatible

Bug #1826627 reported by Steve Murphy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Folder Color
Fix Released
High
costales

Bug Description

Extension fails display context menu entry with Nemo 4.0.x and later. Nemo extensions for 4.0.x and later are required to be python3 compatible.

Running Nemo from a terminal on opening the right click context menu the following error is produced.

Traceback (most recent call last):
  File "/usr/share/nemo-python/extensions/folder-color.py", line 168, in get_file_items
    return self._generate_menu(items)
  File "/usr/share/nemo-python/extensions/folder-color.py", line 240, in _generate_menu
    if self._check_generate_restore(items):
  File "/usr/share/nemo-python/extensions/folder-color.py", line 297, in _check_generate_restore
    item_path = urllib.unquote(item.get_uri()[7:])
AttributeError: module 'urllib' has no attribute 'unquote'

Workaround - in /usr/share/nemo-python/extensions/folder-color.py replace all instances of urllib.unquote with urllib.parse.unquote e.g

sudo sed -i "s|urllib.unquote|urllib.parse.unquote|g" /usr/share/nemo-python/extensions/folder-color.py

Nemo 4.0.x is the default version in Mint Cinnamon 19.1 which uses the Bionic version of the package.

steve@steve-HP-Pavilion-g6-Notebook-PC:~$ inxi -Sxxxz
System:
  Host: steve-HP-Pavilion-g6-Notebook-PC Kernel: 4.15.0-48-generic x86_64
  bits: 64 compiler: gcc v: 7.3.0 Desktop: Cinnamon 4.0.10 wm: muffin 4.0.7
  dm: LightDM 1.26.0 Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04 bionic
steve@steve-HP-Pavilion-g6-Notebook-PC:~$ nemo --version
nemo 4.0.6

Related branches

Steve Murphy (smurphos)
summary: - Nemo verion 4.0.x + requires extensions to be Python3 compatible
+ Nemo version 4.0.x + requires extensions to be Python3 compatible
description: updated
description: updated
Revision history for this message
costales (costales) wrote :

Hi Steve,
Could you confirm me the folder color version too?
Where can I test it with a flesh installation? Mint 19.1?
Thanks in advance!

Revision history for this message
Steve Murphy (smurphos) wrote :

Hi, issue noted with versions 0.0.86 and 0.0.87 from https://launchpad.net/~costales/+archive/ubuntu/folder-color

You should be able to test with Mint 19.1 or any *buntu with Nemo installed and updated to 4.0.x from https://launchpad.net/~embrosyn/+archive/ubuntu/cinnamon

Revision history for this message
costales (costales) wrote : Re: [Bug 1826627] Re: Nemo version 4.0.x + requires extensions to be Python3 compatible

Thanks a lot Steve!
It's a bit weird because all Ubuntu is migrated to Python3 and Folder Color
too.
I'll review it and ping you here.
A hug and thanks again!

Revision history for this message
costales (costales) wrote :

Hi Steve,

Appears Nemo runs python2 in previous versions.

The official examples, doesn't invoke the Python version. But they deal
with this issue importing at the start checking an exception:
https://github.com/GNOME/nautilus-python/blob/master/examples/open-terminal.py

# A way to get unquote working with python 2 and 3
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote

And then, calling the library as:

filename = unquote(file.get_uri()[7:])

Please, could you confirm me that this is working in your system?

Thanks in advance and an hug.

Revision history for this message
costales (costales) wrote :

Hi Steve,

Could you test the attachment?

Thanks in advance!

Revision history for this message
costales (costales) wrote :

Hi Steve,

Could you test the attachment?

Thanks in advance!

costales (costales)
Changed in folder-color:
status: New → In Progress
importance: Undecided → High
assignee: nobody → costales (costales)
status: In Progress → Fix Committed
Revision history for this message
Steve Murphy (smurphos) wrote :

Hi, I will test but I'm away from home and my PC for a few days so it will
be next week sometime.

Thanks for the quick response.

On Sat, 27 Apr 2019, 18:35 costales, <email address hidden> wrote:

> Hi Steve,
>
> Could you test the attachment?
>
> Thanks in advance!
>
> ** Attachment added: "folder-color.py"
>
> https://bugs.launchpad.net/folder-color/+bug/1826627/+attachment/5259550/+files/folder-color.py
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1826627
>
> Title:
> Nemo version 4.0.x + requires extensions to be Python3 compatible
>
> Status in Folder Color:
> New
>
> Bug description:
> Extension fails display context menu entry with Nemo 4.0.x and later.
> Nemo extensions for 4.0.x and later are required to be python3
> compatible.
>
> Running Nemo from a terminal on opening the right click context menu
> the following error is produced.
>
> Traceback (most recent call last):
> File "/usr/share/nemo-python/extensions/folder-color.py", line 168, in
> get_file_items
> return self._generate_menu(items)
> File "/usr/share/nemo-python/extensions/folder-color.py", line 240, in
> _generate_menu
> if self._check_generate_restore(items):
> File "/usr/share/nemo-python/extensions/folder-color.py", line 297, in
> _check_generate_restore
> item_path = urllib.unquote(item.get_uri()[7:])
> AttributeError: module 'urllib' has no attribute 'unquote'
>
> Workaround - in /usr/share/nemo-python/extensions/folder-color.py
> replace all instances of urllib.unquote with urllib.parse.unquote e.g
>
> sudo sed -i "s|urllib.unquote|urllib.parse.unquote|g" /usr/share/nemo-
> python/extensions/folder-color.py
>
> Nemo 4.0.x is the default version in Mint Cinnamon 19.1 which uses the
> Bionic version of the package.
>
> steve@steve-HP-Pavilion-g6-Notebook-PC:~$ inxi -Sxxxz
> System:
> Host: steve-HP-Pavilion-g6-Notebook-PC Kernel: 4.15.0-48-generic x86_64
> bits: 64 compiler: gcc v: 7.3.0 Desktop: Cinnamon 4.0.10 wm: muffin
> 4.0.7
> dm: LightDM 1.26.0 Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04
> bionic
> steve@steve-HP-Pavilion-g6-Notebook-PC:~$ nemo --version
> nemo 4.0.6
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/folder-color/+bug/1826627/+subscriptions
>

Revision history for this message
costales (costales) wrote :

Don't worry then, I will test it in Mint :) A.hug and thanks a lot for the
feedback and help

On Sat, Apr 27, 2019, 21:30 Steve Murphy <email address hidden> wrote:

> Hi, I will test but I'm away from home and my PC for a few days so it will
> be next week sometime.
>
> Thanks for the quick response.
>
> On Sat, 27 Apr 2019, 18:35 costales, <email address hidden> wrote:
>
> > Hi Steve,
> >
> > Could you test the attachment?
> >
> > Thanks in advance!
> >
> > ** Attachment added: "folder-color.py"
> >
> >
> https://bugs.launchpad.net/folder-color/+bug/1826627/+attachment/5259550/+files/folder-color.py
> >
> > --
> > You received this bug notification because you are subscribed to the bug
> > report.
> > https://bugs.launchpad.net/bugs/1826627
> >
> > Title:
> > Nemo version 4.0.x + requires extensions to be Python3 compatible
> >
> > Status in Folder Color:
> > New
> >
> > Bug description:
> > Extension fails display context menu entry with Nemo 4.0.x and later.
> > Nemo extensions for 4.0.x and later are required to be python3
> > compatible.
> >
> > Running Nemo from a terminal on opening the right click context menu
> > the following error is produced.
> >
> > Traceback (most recent call last):
> > File "/usr/share/nemo-python/extensions/folder-color.py", line 168,
> in
> > get_file_items
> > return self._generate_menu(items)
> > File "/usr/share/nemo-python/extensions/folder-color.py", line 240,
> in
> > _generate_menu
> > if self._check_generate_restore(items):
> > File "/usr/share/nemo-python/extensions/folder-color.py", line 297,
> in
> > _check_generate_restore
> > item_path = urllib.unquote(item.get_uri()[7:])
> > AttributeError: module 'urllib' has no attribute 'unquote'
> >
> > Workaround - in /usr/share/nemo-python/extensions/folder-color.py
> > replace all instances of urllib.unquote with urllib.parse.unquote e.g
> >
> > sudo sed -i "s|urllib.unquote|urllib.parse.unquote|g" /usr/share/nemo-
> > python/extensions/folder-color.py
> >
> > Nemo 4.0.x is the default version in Mint Cinnamon 19.1 which uses the
> > Bionic version of the package.
> >
> > steve@steve-HP-Pavilion-g6-Notebook-PC:~$ inxi -Sxxxz
> > System:
> > Host: steve-HP-Pavilion-g6-Notebook-PC Kernel: 4.15.0-48-generic
> x86_64
> > bits: 64 compiler: gcc v: 7.3.0 Desktop: Cinnamon 4.0.10 wm: muffin
> > 4.0.7
> > dm: LightDM 1.26.0 Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04
> > bionic
> > steve@steve-HP-Pavilion-g6-Notebook-PC:~$ nemo --version
> > nemo 4.0.6
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/folder-color/+bug/1826627/+subscriptions
> >
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1826627
>
> Title:
> Nemo version 4.0.x + requires extensions to be Python3 compatible
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/folder-color/+bug/1826627/+subscriptions
>

Revision history for this message
costales (costales) wrote :

Hi Steve,
I tried in Mint and it works.
I'll upload the new version (0.0.88) to the PPA.
Please, if you find something wrong, ping me again :)
A hug!

Changed in folder-color:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.