[Bug 1242778] Re: python-apt malforms source lines with multiple options

Rohit R 1242778 at bugs.launchpad.net
Mon Oct 21 17:21:47 UTC 2013


*** This bug is a duplicate of bug 1103200 ***
    https://bugs.launchpad.net/bugs/1103200

** This bug has been marked a duplicate of bug 1103200
   apt-add-repository corrupts sources.list with multiple options

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-apt in Ubuntu.
https://bugs.launchpad.net/bugs/1242778

Title:
  python-apt malforms source lines with multiple options

Status in “python-apt” package in Ubuntu:
  New

Bug description:
  The str() method in SourceEntry class, has malforms the source line.

  Console out:

  Python 2.7.3 (default, Apr 10 2013, 06:20:15)
  [GCC 4.6.3] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> from aptsources.sourceslist import SourceEntry
  >>> s = SourceEntry('deb [arch=amd64 trusted=yes] http://ppa.launchpad.net/xubuntu-dev/xfce-4.10/ubuntu precise main')
  >>> s.str()
  'deb [arch=amd64] trusted=yes] http://ppa.launchpad.net/xubuntu-dev/xfce-4.10/ubuntu precise main\n'

  Note the extra "]". This leads to apt-add-repository to malform some
  entries.

  Edit:

  The parsing itself is wrong.

  Python 2.7.3 (default, Apr 10 2013, 06:20:15) 
  [GCC 4.6.3] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> from aptsources.sourceslist import SourceEntry
  >>> s = SourceEntry('deb [arch=amd64 trusted=yes] http://ppa.launchpad.net/xubuntu-dev/xfce-4.10/ubuntu precise main')
  >>> s.architectures
  ['amd64']
  >>> s.uri
  'trusted=yes]'
  >>> s.dist
  'http://ppa.launchpad.net/xubuntu-dev/xfce-4.10/ubuntu'
  >>> s.comps
  ['precise', 'main']

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1242778/+subscriptions



More information about the foundations-bugs mailing list