"Import Key File" fails when the path of the file has special characters
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
software-properties (Ubuntu) |
Triaged
|
Medium
|
Unassigned | ||
Trusty |
Triaged
|
Medium
|
Unassigned |
Bug Description
[Impact]
Importing a key that is in a path that contains special characters (like "/home/
[Test Case]
1. Download a PGP key for a Debian repository (for example, the VideoLAN
team's key: download.
2. Move the key file to a folder that contains special characters, or rename
the file to contain them (example: VídeoLAN.asc).
3. Open "Software & Updates" from the Dash, then select the Authentication
tab.
4. Press the "Import Key File..." button and then choose the key file.
Admin authentication should then be requested, so authenticate yourself.
If the bug is fixed: the key should now appear in the list of keys.
If not: the key was not added.
[Regression Potential]
If the fix is not correct, I suppose it could potentially break the "import key" feature even more, so it wouldn't work even in "normal" paths.
[Original Report]
The "Import Key File..." button in the "Authentication" tab fails silently when the path of the selected key file includes special characters.
I'm using Ubuntu in Portuguese, so the "/home/
Adding a key from that folder fails, but adding a key from "/home/$USER" (no special characters) succeeds.
The problem is that, in softwarepropert
if res == Gtk.ResponseTyp
try:
if not self.backend.
except dbus.DBusException as e:
if e._dbus_error_name == 'com.ubuntu.
"self.backend.
This is probably a side effect of switching from Python 2 to 3 (and 'bytes' now being used in network communications where 'str' was previously used).
Another issue is that the error isn't reported to the user, and it should be.
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: software-
ProcVersionSign
Uname: Linux 3.13.0-37-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.5
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Oct 14 13:22:21 2014
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-10-13 (0 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
PackageArchitec
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Michael Vogt (community): Approve
-
Diff: 11 lines (+1/-0)1 file modifiedsoftwareproperties/SoftwareProperties.py (+1/-0)
- Brian Murray: Approve
- Michael Vogt: Approve
-
Diff: 47 lines (+6/-5)2 files modifiedsoftwareproperties/SoftwareProperties.py (+2/-4)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+4/-1)
- Brian Murray: Needs Fixing
- Michael Vogt: Pending requested
-
Diff: 16 lines (+3/-2)1 file modifiedsoftwareproperties/SoftwareProperties.py (+3/-2)
Changed in software-properties (Ubuntu Trusty): | |
status: | New → In Progress |
importance: | Undecided → Medium |
description: | updated |
Changed in software-properties (Ubuntu Trusty): | |
status: | Fix Committed → In Progress |
Changed in software-properties (Ubuntu Trusty): | |
status: | Fix Released → In Progress |
Changed in software-properties (Ubuntu): | |
assignee: | Brian Murray (brian-murray) → nobody |
status: | In Progress → Triaged |
Changed in software-properties (Ubuntu Trusty): | |
status: | In Progress → Triaged |
Changed in software-properties (Ubuntu Trusty): | |
status: | Triaged → Confirmed |
Changed in software-properties (Ubuntu Trusty): | |
status: | Confirmed → Triaged |
Here's a traceback of the exception:
org.freedesktop .DBus.Python. UnicodeEncodeEr ror: Traceback (most recent call last): python3/ dist-packages/ dbus/service. py", line 707, in _message_cb method( self, *args, **keywords) python3/ dist-packages/ softwarepropert ies/dbus/ SoftwarePropert iesDBus. py", line 288, in AddKey python3/ dist-packages/ softwarepropert ies/SoftwarePro perties. py", line 800, in add_key exists( path): python3. 4/genericpath. py", line 19, in exists
File "/usr/lib/
retval = candidate_
File "/usr/lib/
return self.add_key(path)
File "/usr/lib/
if not os.path.
File "/usr/lib/
os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character '\xea' in position 20: ordinal not in range(128)