Creates sources.list.d file with illegal character in name

Bug #579669 reported by Adam Guthrie on 2010-05-12
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Software Properties
software-properties (Ubuntu)

Bug Description

For example:

apt-add-repository ppa:sevenmachines/release+1

creates a file /etc/apt/sources.list.d/sevenmachines-release+1-lucid.list.

However, man sources.list says

File names need to end with .list and may only contain letters (a-z and A-Z), digits (0-9), underscore (_), hyphen (-) and period (.) characters. Otherwise they will be silently ignored.

So therefore this newly created list file is silently ignored (verify by apt-get update and looking in /var/lib/apt/lists)

Ubuntu 10.04
python-software-properties 0.75.10

Related branches

(+) may be seen as an invalid character for a sources.list entry.
You have already pointed out valid characters and (+) is not one of those.

Changed in software-properties (Ubuntu):
status: New → Incomplete
Adam Guthrie (therigu) on 2010-05-13
description: updated
Adam Guthrie (therigu) on 2010-05-13
summary: - Creates sources.list.d file will illegal character in name
+ Creates sources.list.d file with illegal character in name
Changed in software-properties:
status: New → Incomplete
Adam Guthrie (therigu) wrote :

Here's a patch to fix this issue.

Adam Guthrie (therigu) wrote :

Marking as confirmed due to the duplicate bug

Changed in software-properties:
status: Incomplete → Confirmed
Changed in software-properties (Ubuntu):
status: Incomplete → Confirmed
mac9416 (mac9416) wrote :

Hi, Adam,

What does your patch change the + in sources.list.d lists to? For me, "sevenmachines-release+1-lucid.list" became "sevenmachines-release-2B1-lucid.list". Is this what should happen?

mac9416 (mac9416) wrote :

I went ahead and submitted a merge request for the patch. It seems to do what its supposed to do. If there's anything wrong, the software-properties folks will catch it.

Here's the request:

tags: added: patch-forwarded-upstream
Adam Guthrie (therigu) wrote :

That's correct. The patch uses percent encoding (, except '%' is also a reserved character here, so we escape '-' and then use '-' and the escape character by replacing '%' with '-'.

The patch can be tidied slightly by using urllib2.quote rather than urllib.quote, thus removing the need to import urllib (I didn't realise urllib2 exposed urlib's quote at the time I wrote the patch)

Adam Guthrie (therigu) wrote :

* as the escape character

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.76

software-properties (0.76) maverick; urgency=low

  [ Jonathan Harker ]
  * Improve documentation for apt-add-repository (LP: #586790)

  [ mac9416 ]
  * Fixed bug LP: #446216: added --remove option to add-apt-reporitory.
  * Fixed Bug LP: #579669 which points out that add-apt-repository will
    create a sources.list.d file with illegal characters
    if there are illegal characters in a PPA name

  [ Andrea Corbellini ]
  * Automatically create a deb-src line when adding a new repository
    (LP: 399711)

  [ Michael Vogt ]
  * add test for LP: #579669 and use re.sub() instead of urllib.quote()
  * merged lp:~alexzak/software-properties/fixes, many thanks

  [ Erik B. Andersen ]
  * Fixed depreciation warnings

  [ Brandon Tomlinson ]
  * Altered data/glade/ Put the bottom buttons in a button box
    to make the buttons assume the correct width (LP: #515990)
 -- Michael Vogt <email address hidden> Fri, 13 Aug 2010 17:38:45 +0200

Changed in software-properties (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers