The significant change between python-software-properties 0.82.7 and
0.82.7.3 is in the .3 release: "softwareproperties/ppa.py: download gpg
key to temporary keyring, and validate using v4 fingerprint before
importing to apt keyring." (Specifically, that change is the reason
that tempfile.mkdtemp() is called in the later version of the package.)
However, this doesn't seem to be a bug in the python-software-properties
code itself, but rather some strange interaction between the "pycurl"
module (used directly by ppa.py) and the "random" module (used by the
tempdir module).
That is, I'm able to reproduce the problem in an interactive python
session, without using any software-properties .py files:
==========================
$ uname -a
Linux pincup 3.2.0-38-generic-pae #61-Ubuntu SMP Tue Feb 19 12:39:51 UTC 2013
i686 athlon i386 GNU/Linux
$ python
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pycurl, tempfile
>>> def geturl(url):
... curl=pycurl.Curl()
... curl.setopt(pycurl.URL,url)
... curl.perform()
... print
... print "before:", tempfile.mkdtemp()
... curl.close()
... print "after:", tempfile.mkdtemp()
...
>>> geturl("http://launchpad.net/api/")
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://launchpad.net/api/">here</a>.</p>
<hr>
<address>Apache/2.2.14 (Ubuntu) Server at launchpad.net Port 80</address>
</body></html>
before: /tmp/tmpuXD_at
after: /tmp/tmpon2PEe
>>> geturl("https://launchpad.net/api/")
Object: <lp.services.webapp.servers.WebServiceClientRequest instance
URL=https://launchpad.net>, name: ''
before: /tmp/tmpGMMoKM
after:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 8, in geturl
File "/usr/lib/python2.7/tempfile.py", line 322, in mkdtemp
name = names.next()
File "/usr/lib/python2.7/tempfile.py", line 141, in next
letters = [choose(c) for dummy in "123456"]
File "/usr/lib/python2.7/random.py", line 274, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is
empty
ValueError: cannot convert float NaN to integer
>>> tempfile.mkdtemp()
'/tmp/tmpCoJDyZ'
==========================
So, it seems to be triggered by the curl.close() call, but only after an
https: URL has been accessed. Also, note that the ValueError happens
only one time; the next call to mkdtemp() works normally again.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1063350
Title:
add-apt-repository and apt-add-repository fails
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1063350/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs